Skip to content

Commit

Permalink
Merge branch 'android10'
Browse files Browse the repository at this point in the history
  • Loading branch information
yshrsmz committed Sep 16, 2019
2 parents 0e8fdba + 1bc70bb commit 94c10e9
Show file tree
Hide file tree
Showing 75 changed files with 861 additions and 426 deletions.
52 changes: 15 additions & 37 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 23 additions & 25 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def TWITTER_API_KEY = "\"${getSecretProperty('twitter.api.key')}\""
def TWITTER_API_SECRET = "\"${getSecretProperty('twitter.api.secret')}\""

android {
compileSdkVersion 28
compileSdkVersion 29

signingConfigs {
debug {
Expand All @@ -36,10 +36,10 @@ android {

defaultConfig {
applicationId "net.yslibrary.monotweety"
minSdkVersion 19
targetSdkVersion 28
versionCode 56
versionName "1.8.3"
minSdkVersion 21
targetSdkVersion 29
versionCode 58
versionName "1.9.0"

buildConfigField 'String', 'TWITTER_API_KEY', TWITTER_API_KEY
buildConfigField 'String', 'TWITTER_API_SECRET', TWITTER_API_SECRET
Expand Down Expand Up @@ -127,35 +127,33 @@ kapt {
}
}

ext.retrofit_version = '2.5.0'
ext.retrofit_version = '2.6.1'
ext.androidx_version = '1.0.0'
ext.rxbinding_version = '2.2.0'
ext.conductor_version = '2.1.5'
ext.okhttp_version = '3.12.1'
ext.dagger_version = '2.20'
ext.conductor_version = '3.0.0-rc2'
ext.okhttp_version = '4.2.0'
ext.dagger_version = '2.24'
ext.storio_version = '3.0.0'
ext.leakcanary_version = '1.6.2'
ext.glide_version = '4.8.0'
ext.leakcanary_version = '1.6.3'
ext.glide_version = '4.9.0'
dependencies {
kapt "com.android.tools.build.jetifier:jetifier-core:1.0.0-beta02"
annotationProcessor "com.android.tools.build.jetifier:jetifier-core:1.0.0-beta02"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.recyclerview:recyclerview:$androidx_version"
implementation "com.google.android.material:material:$androidx_version"
implementation "androidx.multidex:multidex:2.0.1"

implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-analytics:17.2.0'

implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"

implementation 'com.twitter.twittertext:twitter-text:3.0.1'
implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') {
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
transitive = true;
}
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
Expand All @@ -166,9 +164,9 @@ dependencies {

implementation "com.pushtorefresh.storio3:sqlite:$storio_version"

implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.5'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'

implementation 'com.gojuno.koptional:koptional:1.6.0'
implementation 'com.gojuno.koptional:koptional-rxjava2-extensions:1.6.0'
Expand All @@ -180,7 +178,7 @@ dependencies {
implementation "com.jakewharton.rxbinding2:rxbinding-appcompat-v7-kotlin:$rxbinding_version"
implementation "com.jakewharton.rxbinding2:rxbinding-recyclerview-v7-kotlin:$rxbinding_version"

implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.0'
implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1'

implementation 'com.f2prateek.rx.preferences2:rx-preferences:2.0.0'

Expand All @@ -190,12 +188,12 @@ dependencies {

implementation 'com.hannesdorfmann:adapterdelegates3:3.1.0'

implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"

implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'

implementation 'net.yslibrary.licenseadapter:licenseadapter:2.2.2'

Expand All @@ -207,16 +205,16 @@ dependencies {
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"

debugImplementation 'com.facebook.stetho:stetho:1.5.0'
debugImplementation 'com.facebook.stetho:stetho:1.5.1'


testImplementation 'androidx.test:core:1.1.0'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation "com.nhaarman:mockito-kotlin:1.6.0"
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version"
testImplementation 'org.robolectric:robolectric:4.1'
testImplementation 'org.robolectric:robolectric:4.3'
}
repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ open class AppLifecycleCallbacks(
}

fun initTwitterKit() {
val authConfig = TwitterAuthConfig(BuildConfig.TWITTER_API_KEY, BuildConfig.TWITTER_API_SECRET)
val authConfig = TwitterAuthConfig(
BuildConfig.TWITTER_API_KEY,
BuildConfig.TWITTER_API_SECRET
)
val twitterConfig = TwitterConfig.Builder(context)
.twitterAuthConfig(authConfig)
//.debug(true)
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/net/yslibrary/monotweety/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ open class AppModule(private val context: Context) {

@AppScope
@Provides
open fun provideAppLifecycleCallbacks(@Named(Names.FOR_APP) context: Context, notificationManager: NotificationManager): App.LifecycleCallbacks {
open fun provideAppLifecycleCallbacks(
@Named(Names.FOR_APP) context: Context,
notificationManager: NotificationManager
): App.LifecycleCallbacks {
return AppLifecycleCallbacks(context, notificationManager)
}

Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/net/yslibrary/monotweety/Config.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package net.yslibrary.monotweety

data class Config(val developerUrl: String,
val googlePlayUrl: String,
val githubUrl: String,
val privacyPolicyUrl: String,
val statusMaxLength: Int = 140) {
data class Config(
val developerUrl: String,
val googlePlayUrl: String,
val githubUrl: String,
val privacyPolicyUrl: String,
val statusMaxLength: Int = 140
) {
companion object {
fun init(): Config {
return Config(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ class ComposeActivity : BaseActivity(), ActionBarProvider, HasComponent<ComposeA
intent.putExtra(KEY_STATUS, status)
}

intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
or Intent.FLAG_ACTIVITY_NEW_TASK)
intent.addFlags(
Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
or Intent.FLAG_ACTIVITY_NEW_TASK
)

return intent
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class CreateShortcutActivity : Activity() {
.setIntent(shortcut)
.build()

val resultIntent = ShortcutManagerCompat.createShortcutResultIntent(applicationContext, shortcutInfo)
val resultIntent = ShortcutManagerCompat
.createShortcutResultIntent(applicationContext, shortcutInfo)

setResult(RESULT_OK, resultIntent)
finish()
Expand Down
17 changes: 14 additions & 3 deletions app/src/main/java/net/yslibrary/monotweety/analytics/Analytics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class Analytics @Inject constructor(private val analytics: FirebaseAnalytics) {

private const val EVENT_TWEET_FROM_EDITOR = "tweet_from_editor"
private const val EVENT_TWEET_FROM_NOTIFICATION = "tweet_from_notification"
private const val EVENT_TWEET_FROM_NOTIFICATION_BUT_TOO_LONG = "tweet_from_notification_but_too_long"
private const val EVENT_TWEET_FROM_NOTIFICATION_BUT_TOO_LONG =
"tweet_from_notification_but_too_long"

const val VIEW_SPLASH = "splash"
const val VIEW_LOGIN = "login"
Expand All @@ -36,7 +37,10 @@ class Analytics @Inject constructor(private val analytics: FirebaseAnalytics) {
fun tweetFromNotificationButTooLong() {
Bundle().apply {
putString(FirebaseAnalytics.Param.ITEM_NAME, NAME_TWEET)
putString(FirebaseAnalytics.Param.CONTENT_TYPE, EVENT_TWEET_FROM_NOTIFICATION_BUT_TOO_LONG)
putString(
FirebaseAnalytics.Param.CONTENT_TYPE,
EVENT_TWEET_FROM_NOTIFICATION_BUT_TOO_LONG
)
}.let {
Timber.i("analytics event: %s", EVENT_TWEET_FROM_NOTIFICATION_BUT_TOO_LONG)
analytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, it)
Expand Down Expand Up @@ -67,6 +71,13 @@ class Analytics @Inject constructor(private val analytics: FirebaseAnalytics) {
}

@Retention(AnnotationRetention.SOURCE)
@StringDef(VIEW_SPLASH, VIEW_LOGIN, VIEW_SETTING, VIEW_LICENSE, VIEW_CHANGELOG, VIEW_COMPOSE_STATUS)
@StringDef(
VIEW_SPLASH,
VIEW_LOGIN,
VIEW_SETTING,
VIEW_LICENSE,
VIEW_CHANGELOG,
VIEW_COMPOSE_STATUS
)
annotation class ViewEventType
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package net.yslibrary.monotweety.base

import androidx.appcompat.app.ActionBar
import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.ActionBar
import net.yslibrary.monotweety.activity.ActionBarProvider

abstract class ActionBarController : BaseController() {
Expand Down
Loading

0 comments on commit 94c10e9

Please sign in to comment.