├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── ic_user.png │ │ │ │ ├── ic_issue.png │ │ │ │ ├── ic_login.png │ │ │ │ ├── ic_logout.png │ │ │ │ ├── ic_search.png │ │ │ │ ├── ic_stacks.png │ │ │ │ ├── ic_store.png │ │ │ │ ├── ic_androcat.png │ │ │ │ ├── ic_dark_mode.png │ │ │ │ ├── ic_production.png │ │ │ │ ├── ic_pull_request.png │ │ │ │ ├── ic_repository.png │ │ │ │ ├── ic_androcat_dash.png │ │ │ │ ├── ic_notifications.png │ │ │ │ ├── ic_under_progress.png │ │ │ │ ├── ic_user_settings.png │ │ │ │ ├── dark_mode_screen_shoot.png │ │ │ │ ├── cursor_color.xml │ │ │ │ ├── background_splash.xml │ │ │ │ ├── ic_gist.xml │ │ │ │ ├── ic_back.xml │ │ │ │ ├── ic_forward.xml │ │ │ │ ├── ic_trends.xml │ │ │ │ ├── ic_stars.xml │ │ │ │ ├── ic_dismiss.xml │ │ │ │ ├── ic_feedback.xml │ │ │ │ ├── ic_projects.xml │ │ │ │ ├── ic_explore.xml │ │ │ │ ├── ic_disable_ads.xml │ │ │ │ ├── ic_find_in_page.xml │ │ │ │ ├── ic_bug_report.xml │ │ │ │ ├── ic_settings.xml │ │ │ │ ├── ic_app_settings.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── values │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── float.xml │ │ │ │ ├── integer.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── values-land │ │ │ │ └── float.xml │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── slide_dark_mode.xml │ │ │ │ ├── activity_slider.xml │ │ │ │ ├── slide_intro.xml │ │ │ │ ├── slide_bug_report.xml │ │ │ │ ├── slide_disable_ads.xml │ │ │ │ ├── layout_find_in_page.xml │ │ │ │ ├── layout_fillable_loader.xml │ │ │ │ └── fragment_main.xml │ │ │ ├── anim │ │ │ │ ├── fade_out.xml │ │ │ │ ├── fade_in.xml │ │ │ │ ├── exit_to_left.xml │ │ │ │ ├── exit_to_right.xml │ │ │ │ ├── enter_from_left.xml │ │ │ │ └── enter_from_right.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ └── menu │ │ │ │ └── bnvm_dash.xml │ │ ├── assets │ │ │ ├── getUsername.js │ │ │ └── normalMode.js │ │ ├── java │ │ │ └── mustafaozhan │ │ │ │ └── github │ │ │ │ └── com │ │ │ │ └── androcat │ │ │ │ ├── model │ │ │ │ ├── User.kt │ │ │ │ ├── Settings.kt │ │ │ │ └── RemoteConfig.kt │ │ │ │ ├── notification │ │ │ │ ├── model │ │ │ │ │ ├── NotificationType.kt │ │ │ │ │ └── Notification.kt │ │ │ │ ├── NotificationReceiver.kt │ │ │ │ └── NotificationUtil.kt │ │ │ │ ├── splash │ │ │ │ ├── SplashActivityViewModel.kt │ │ │ │ └── SplashActivity.kt │ │ │ │ ├── slider │ │ │ │ ├── SliderActivityViewModel.kt │ │ │ │ ├── adapter │ │ │ │ │ └── ViewPagerAdapter.kt │ │ │ │ └── SliderActivity.kt │ │ │ │ ├── tools │ │ │ │ ├── TextSize.kt │ │ │ │ ├── JsScrip.kt │ │ │ │ ├── DataManager.kt │ │ │ │ ├── GeneralSharedPreferences.kt │ │ │ │ └── AccessTokenUtil.kt │ │ │ │ ├── base │ │ │ │ ├── api │ │ │ │ │ ├── github │ │ │ │ │ │ ├── GitHubApiServices.kt │ │ │ │ │ │ └── GitHubApiHelper.kt │ │ │ │ │ ├── BaseApiHelper.kt │ │ │ │ │ ├── RetrofitException.kt │ │ │ │ │ └── RxErrorHandlingCallAdapterFactory.kt │ │ │ │ ├── BaseMvvmActivity.kt │ │ │ │ ├── BaseMvvmFragment.kt │ │ │ │ ├── BaseBroadcastReceiver.kt │ │ │ │ ├── BaseViewModel.kt │ │ │ │ ├── BaseSharedPreferences.kt │ │ │ │ ├── BaseFragment.kt │ │ │ │ └── BaseActivity.kt │ │ │ │ ├── dagger │ │ │ │ ├── module │ │ │ │ │ ├── BroadcastReceiverModule.kt │ │ │ │ │ ├── ViewModelModule.kt │ │ │ │ │ └── ApplicationModule.kt │ │ │ │ └── component │ │ │ │ │ ├── BroadcastReceiverComponent.kt │ │ │ │ │ ├── ApplicationComponent.kt │ │ │ │ │ └── ViewModelComponent.kt │ │ │ │ ├── main │ │ │ │ ├── activity │ │ │ │ │ ├── MainActivityViewModel.kt │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── fragment │ │ │ │ │ ├── MainFragmentViewModel.kt │ │ │ │ │ ├── BaseMainFragment.kt │ │ │ │ │ └── MainFragment.kt │ │ │ │ ├── annontation │ │ │ │ └── annontation.kt │ │ │ │ ├── extensions │ │ │ │ ├── DataExtensions.kt │ │ │ │ ├── ViewExtensions.kt │ │ │ │ └── initialisationExtensions.kt │ │ │ │ ├── settings │ │ │ │ ├── SettingsFragmentViewModel.kt │ │ │ │ └── SettingsFragment.kt │ │ │ │ ├── application │ │ │ │ └── Application.kt │ │ │ │ └── view │ │ │ │ └── CurvedBottomNavigationView.kt │ │ └── AndroidManifest.xml │ ├── debug │ │ └── res │ │ │ └── values │ │ │ └── strings.xml │ ├── test │ │ └── java │ │ │ └── mustafaozhan │ │ │ └── github │ │ │ └── com │ │ │ └── androcat │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── mustafaozhan │ │ └── github │ │ └── com │ │ └── androcat │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── PrivacyPolicy.md ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_issue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_issue.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_login.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_logout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_stacks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_stacks.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_store.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_androcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_androcat.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dark_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_dark_mode.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_production.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_production.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pull_request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_pull_request.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_repository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_repository.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_androcat_dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_androcat_dash.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_notifications.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_under_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_under_progress.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_user_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/ic_user_settings.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/dark_mode_screen_shoot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/drawable/dark_mode_screen_shoot.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobilCat/AndroCat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /app/src/main/assets/getUsername.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | return document 3 | .getElementsByClassName("form-control input-block") 4 | .login_field 5 | .value; 6 | }()); -------------------------------------------------------------------------------- /app/src/main/res/drawable/cursor_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/model/User.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.model 2 | 3 | data class User( 4 | var username: String? = null, 5 | var isLoggedIn: Boolean? = null, 6 | var token: String? = null 7 | ) 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/float.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.945 4 | 0.5 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-land/float.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.9 4 | 0.33 5 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/notification/model/NotificationType.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.notification.model 2 | 3 | enum class NotificationType(val value: String) { 4 | PULL_REQUEST("PullRequest"), 5 | ISSUE("Issue") 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 03 20:55:41 CEST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/splash/SplashActivityViewModel.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.splash 2 | 3 | import mustafaozhan.github.com.androcat.base.BaseViewModel 4 | 5 | class SplashActivityViewModel : BaseViewModel() { 6 | override fun inject() = viewModelComponent.inject(this) 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /app/src/debug/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ca-app-pub-3940256099942544/1033173712 4 | ca-app-pub-3940256099942544/6300978111 5 | ca-app-pub-3940256099942544/5224354917 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/slider/SliderActivityViewModel.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.slider 2 | 3 | import mustafaozhan.github.com.androcat.base.BaseViewModel 4 | 5 | class SliderActivityViewModel : BaseViewModel() { 6 | override fun inject() { 7 | viewModelComponent.inject(this) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/model/Settings.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.model 2 | 3 | import org.joda.time.Instant 4 | 5 | data class Settings( 6 | var darkMode: Boolean? = false, 7 | var sliderShown: Boolean? = false, 8 | var isNotificationOn: Boolean? = false, 9 | var adFreeActivatedDate: Instant? 10 | ) 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/tools/TextSize.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.tools 2 | 3 | const val TEXT_SIZE_SMALL = 100 4 | const val TEXT_SIZE_MEDIUM = 124 5 | const val TEXT_SIZE_LARGE = 150 6 | 7 | enum class TextSize(val value: Int) { 8 | SMALL(TEXT_SIZE_SMALL), 9 | MEDIUM(TEXT_SIZE_MEDIUM), 10 | LARGE(TEXT_SIZE_LARGE) 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/anim/exit_to_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/exit_to_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/enter_from_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/enter_from_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/integer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 500 6 | 66 7 | 576 8 | 400 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_gist.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/tools/JsScrip.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.tools 2 | 3 | enum class JsScrip(val value: String) { 4 | NORMAL_MODE("normalMode.js"), 5 | DARK_MODE("darkMode.js"), 6 | GET_USERNAME("getUsername.js"); 7 | 8 | companion object { 9 | fun getTheme(darkMode: Boolean) = 10 | if (darkMode) DARK_MODE else NORMAL_MODE 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_back.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_forward.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_trends.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_stars.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #24282d 4 | #181818 5 | #3f4346 6 | #0097A7 7 | #ffffff 8 | #ECEFF1 9 | #00000000 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dismiss.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/api/github/GitHubApiServices.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base.api.github 2 | 3 | import io.reactivex.Observable 4 | import mustafaozhan.github.com.androcat.notification.model.Notification 5 | import retrofit2.http.GET 6 | import retrofit2.http.Query 7 | 8 | interface GitHubApiServices { 9 | @GET("notifications") 10 | fun getNotifications(@Query("all") all: Boolean): Observable> 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/dagger/module/BroadcastReceiverModule.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.dagger.module 2 | 3 | import android.content.BroadcastReceiver 4 | import dagger.Module 5 | import dagger.Provides 6 | 7 | @Module 8 | class BroadcastReceiverModule(private val broadcastReceiver: BroadcastReceiver) { 9 | 10 | @Provides 11 | internal fun providesBroadcastReceiver(): BroadcastReceiver { 12 | return broadcastReceiver 13 | } 14 | } -------------------------------------------------------------------------------- /app/src/test/java/mustafaozhan/github/com/androcat/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat 2 | 3 | import org.junit.Assert.assertEquals 4 | import org.junit.Test 5 | 6 | /** 7 | * Example local unit test, which will execute on the development machine (host). 8 | * 9 | * See [testing documentation](http://d.android.com/tools/testing). 10 | */ 11 | class ExampleUnitTest { 12 | @Test 13 | fun addition_isCorrect() { 14 | assertEquals(4, 2 + 2) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/dagger/module/ViewModelModule.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.dagger.module 2 | 3 | import androidx.lifecycle.ViewModel 4 | import dagger.Module 5 | import dagger.Provides 6 | 7 | /** 8 | * Created by Mustafa Ozhan on 2018-07-22. 9 | */ 10 | @Module 11 | class ViewModelModule(private val viewModel: ViewModel) { 12 | 13 | @Provides 14 | internal fun providesViewModel(): ViewModel { 15 | return viewModel 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_feedback.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_projects.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/main/activity/MainActivityViewModel.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.main.activity 2 | 3 | import mustafaozhan.github.com.androcat.base.BaseViewModel 4 | import org.joda.time.Instant 5 | 6 | /** 7 | * Created by Mustafa Ozhan on 2018-07-22. 8 | */ 9 | class MainActivityViewModel : BaseViewModel() { 10 | override fun inject() { 11 | viewModelComponent.inject(this) 12 | } 13 | 14 | fun updateAdFreeActivation() = dataManager.updateSettings(adFreeActivatedDate = Instant.now()) 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_explore.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/BaseMvvmActivity.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base 2 | 3 | import androidx.lifecycle.ViewModelProviders 4 | import com.crashlytics.android.Crashlytics 5 | 6 | abstract class BaseMvvmActivity : BaseActivity() { 7 | 8 | protected abstract fun getViewModelClass(): Class 9 | 10 | protected val viewModel: VM by lazy { 11 | ViewModelProviders.of(this).get(getViewModelClass()) 12 | } 13 | 14 | protected fun logException(t: Throwable) = Crashlytics.logException(t) 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_disable_ads.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/annontation/annontation.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.annontation 2 | 3 | import javax.inject.Qualifier 4 | import javax.inject.Scope 5 | 6 | /** 7 | * Created by Mustafa Ozhan on 2018-07-22. 8 | */ 9 | 10 | @Qualifier 11 | @kotlin.annotation.Retention(AnnotationRetention.RUNTIME) 12 | annotation class ApplicationContext 13 | 14 | @Scope 15 | @kotlin.annotation.Retention(AnnotationRetention.RUNTIME) 16 | annotation class PerViewModel 17 | 18 | @Scope 19 | @kotlin.annotation.Retention(AnnotationRetention.RUNTIME) 20 | annotation class PerBroadcastReceiver -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/dagger/component/BroadcastReceiverComponent.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.dagger.component 2 | 3 | import dagger.Subcomponent 4 | import mustafaozhan.github.com.androcat.annontation.PerBroadcastReceiver 5 | import mustafaozhan.github.com.androcat.dagger.module.BroadcastReceiverModule 6 | import mustafaozhan.github.com.androcat.notification.NotificationReceiver 7 | 8 | @PerBroadcastReceiver 9 | @Subcomponent(modules = [(BroadcastReceiverModule::class)]) 10 | interface BroadcastReceiverComponent { 11 | fun inject(notificationReceiver: NotificationReceiver) 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/extensions/DataExtensions.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.extensions 2 | 3 | import io.reactivex.Observable 4 | import io.reactivex.android.schedulers.AndroidSchedulers 5 | import io.reactivex.schedulers.Schedulers 6 | 7 | fun String.remove(str: String) = replace(str, "") 8 | 9 | fun Observable.applySchedulers(): Observable = 10 | observeOn(AndroidSchedulers.mainThread()) 11 | .subscribeOn(Schedulers.io()) 12 | 13 | fun String?.isValidUsername(): Boolean { 14 | return !this.isNullOrEmpty() && this != "null" && !this.contains("@") 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/model/RemoteConfig.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.model 2 | 3 | import com.google.gson.annotations.SerializedName 4 | import mustafaozhan.github.com.androcat.BuildConfig 5 | 6 | data class RemoteConfig( 7 | @SerializedName("title") val title: String, 8 | @SerializedName("description") val description: String, 9 | @SerializedName("update_url") val updateUrl: String, 10 | @SerializedName("force_version") val forceVersion: Int = BuildConfig.VERSION_CODE, 11 | @SerializedName("latest_version") val latestVersion: Int = BuildConfig.VERSION_CODE 12 | ) 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_find_in_page.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/dagger/component/ApplicationComponent.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.dagger.component 2 | 3 | import android.content.Context 4 | import dagger.Component 5 | import mustafaozhan.github.com.androcat.annontation.ApplicationContext 6 | import mustafaozhan.github.com.androcat.dagger.module.ApplicationModule 7 | import javax.inject.Singleton 8 | 9 | /** 10 | * Created by Mustafa Ozhan on 2018-07-22. 11 | */ 12 | @Singleton 13 | @Component(modules = [(ApplicationModule::class)]) 14 | interface ApplicationComponent { 15 | @ApplicationContext 16 | fun context(): Context 17 | 18 | fun viewModelComponent(): ViewModelComponent 19 | 20 | fun broadcastReceiverComponent(): BroadcastReceiverComponent 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/dagger/module/ApplicationModule.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.dagger.module 2 | 3 | import android.content.Context 4 | import dagger.Module 5 | import dagger.Provides 6 | import mustafaozhan.github.com.androcat.annontation.ApplicationContext 7 | import mustafaozhan.github.com.androcat.application.Application 8 | 9 | /** 10 | * Created by Mustafa Ozhan on 2018-07-22. 11 | */ 12 | @Module 13 | class ApplicationModule(private val application: Application) { 14 | 15 | @Provides 16 | internal fun provideApplication(): Application { 17 | return application 18 | } 19 | 20 | @Provides 21 | @ApplicationContext 22 | internal fun provideContext(): Context { 23 | return application.applicationContext 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_bug_report.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/androidTest/java/mustafaozhan/github/com/androcat/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat 2 | 3 | import androidx.test.InstrumentationRegistry 4 | import androidx.test.runner.AndroidJUnit4 5 | import org.junit.Assert.assertEquals 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | /** 10 | * Instrumented test, which will execute on an Android device. 11 | * 12 | * See [testing documentation](http://d.android.com/tools/testing). 13 | */ 14 | @RunWith(AndroidJUnit4::class) 15 | class ExampleInstrumentedTest { 16 | @Test 17 | fun useAppContext() { 18 | // Context of the app under test. 19 | val appContext = InstrumentationRegistry.getTargetContext() 20 | assertEquals("mustafaozhan.github.com.androcat", appContext.packageName) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0dp 4 | 1dp 5 | 2dp 6 | 4dp 7 | 8dp 8 | 10dp 9 | 36dp 10 | 48dp 11 | 72dp 12 | 13 | 36sp 14 | 15 | 150dp 16 | 216dp 17 | 500 18 | 19 | 30dp 20 | 20dp 21 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/settings/SettingsFragmentViewModel.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.settings 2 | 3 | import mustafaozhan.github.com.androcat.base.BaseViewModel 4 | import mustafaozhan.github.com.androcat.extensions.isValidUsername 5 | 6 | /** 7 | * Created by Mustafa Ozhan on 2018-07-22. 8 | */ 9 | class SettingsFragmentViewModel : BaseViewModel() { 10 | 11 | override fun inject() { 12 | viewModelComponent.inject(this) 13 | } 14 | 15 | fun updateUserName(userName: String) { 16 | dataManager.updateUser(username = userName) 17 | } 18 | 19 | fun getUserName(): String? { 20 | val username = dataManager.loadUser().username 21 | return if (username.isValidUsername()) { 22 | username 23 | } else { 24 | null 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/BaseMvvmFragment.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base 2 | 3 | import androidx.lifecycle.ViewModelProviders 4 | import com.crashlytics.android.Crashlytics 5 | import io.reactivex.disposables.CompositeDisposable 6 | 7 | /** 8 | * Created by Mustafa Ozhan on 2018-07-22. 9 | */ 10 | abstract class BaseMvvmFragment : BaseFragment() { 11 | 12 | protected abstract fun getViewModelClass(): Class 13 | 14 | protected val viewModel: VM by lazy { 15 | ViewModelProviders.of(this).get(getViewModelClass()) 16 | } 17 | 18 | protected val compositeDisposable = CompositeDisposable() 19 | 20 | override fun onDestroy() { 21 | super.onDestroy() 22 | compositeDisposable.clear() 23 | } 24 | 25 | protected fun logException(t: Throwable) = Crashlytics.logException(t) 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/menu/bnvm_dash.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 13 | 16 | 17 | 21 | 22 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/BaseBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import io.reactivex.disposables.CompositeDisposable 7 | import mustafaozhan.github.com.androcat.application.Application 8 | import mustafaozhan.github.com.androcat.dagger.component.BroadcastReceiverComponent 9 | import mustafaozhan.github.com.androcat.tools.DataManager 10 | import javax.inject.Inject 11 | 12 | abstract class BaseBroadcastReceiver : BroadcastReceiver() { 13 | protected val broadcastReceiverComponent: BroadcastReceiverComponent by lazy { 14 | Application.instance.component.broadcastReceiverComponent() 15 | } 16 | protected val compositeDisposable = CompositeDisposable() 17 | 18 | @Inject 19 | lateinit var dataManager: DataManager 20 | 21 | init { 22 | inject() 23 | } 24 | 25 | abstract fun inject() 26 | 27 | override fun onReceive(context: Context, intent: Intent) = Unit 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/splash/SplashActivity.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.splash 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import mustafaozhan.github.com.androcat.base.BaseMvvmActivity 6 | import mustafaozhan.github.com.androcat.main.activity.MainActivity 7 | import mustafaozhan.github.com.androcat.slider.SliderActivity 8 | 9 | /** 10 | * Created by Mustafa Ozhan on 2018-07-22. 11 | */ 12 | class SplashActivity : BaseMvvmActivity() { 13 | override fun getViewModelClass(): Class = SplashActivityViewModel::class.java 14 | override fun getLayoutResId(): Int? = null 15 | override fun onCreate(savedInstanceState: Bundle?) { 16 | super.onCreate(savedInstanceState) 17 | startActivity( 18 | Intent( 19 | this, 20 | if (viewModel.getSettings().sliderShown == true) { 21 | MainActivity::class.java 22 | } else { 23 | SliderActivity::class.java 24 | } 25 | ) 26 | ) 27 | finish() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/api/BaseApiHelper.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base.api 2 | 3 | import com.google.gson.Gson 4 | import com.google.gson.GsonBuilder 5 | import io.reactivex.schedulers.Schedulers 6 | import mustafaozhan.github.com.androcat.application.Application 7 | import okhttp3.OkHttpClient 8 | import retrofit2.Retrofit 9 | import retrofit2.converter.gson.GsonConverterFactory 10 | 11 | /** 12 | * Created by Mustafa Ozhan on 7/10/18 at 9:44 PM on Arch Linux wit Love <3. 13 | */ 14 | abstract class BaseApiHelper { 15 | 16 | private val gson: Gson 17 | get() = GsonBuilder().create() 18 | 19 | protected fun getString(resId: Int): String { 20 | return Application.instance.getString(resId) 21 | } 22 | 23 | protected fun initRxRetrofit(endpoint: String, httpClient: OkHttpClient): Retrofit { 24 | return Retrofit.Builder() 25 | .baseUrl(endpoint) 26 | .addConverterFactory(GsonConverterFactory.create(gson)) 27 | .client(httpClient) 28 | .addCallAdapterFactory(RxErrorHandlingCallAdapterFactory.create(Schedulers.io())) 29 | .build() 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/main/fragment/MainFragmentViewModel.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.main.fragment 2 | 3 | import io.reactivex.subjects.PublishSubject 4 | import mustafaozhan.github.com.androcat.base.BaseViewModel 5 | import mustafaozhan.github.com.androcat.extensions.isValidUsername 6 | 7 | /** 8 | * Created by Mustafa Ozhan on 2018-07-22. 9 | */ 10 | class MainFragmentViewModel : BaseViewModel() { 11 | 12 | override fun inject() { 13 | viewModelComponent.inject(this) 14 | } 15 | 16 | var loginSubject: PublishSubject = PublishSubject.create() 17 | 18 | fun getUserName(): String? { 19 | val username = dataManager.loadUser().username 20 | return if (username.isValidUsername()) { 21 | username 22 | } else { 23 | null 24 | } 25 | } 26 | 27 | fun isLoggedIn() = dataManager.loadUser().isLoggedIn 28 | 29 | fun updateUser(username: String? = null, isLoggedIn: Boolean? = null, token: String? = null) = 30 | dataManager.updateUser(username, isLoggedIn, token) 31 | 32 | fun authentication(isLoggedIn: Boolean) = loginSubject.onNext(isLoggedIn) 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/dagger/component/ViewModelComponent.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.dagger.component 2 | 3 | import dagger.Subcomponent 4 | import mustafaozhan.github.com.androcat.annontation.PerViewModel 5 | import mustafaozhan.github.com.androcat.dagger.module.ViewModelModule 6 | import mustafaozhan.github.com.androcat.main.activity.MainActivityViewModel 7 | import mustafaozhan.github.com.androcat.main.fragment.MainFragmentViewModel 8 | import mustafaozhan.github.com.androcat.settings.SettingsFragmentViewModel 9 | import mustafaozhan.github.com.androcat.slider.SliderActivityViewModel 10 | import mustafaozhan.github.com.androcat.splash.SplashActivityViewModel 11 | 12 | /** 13 | * Created by Mustafa Ozhan on 2018-07-22. 14 | */ 15 | @PerViewModel 16 | @Subcomponent(modules = [(ViewModelModule::class)]) 17 | interface ViewModelComponent { 18 | fun inject(mainActivityViewModel: MainActivityViewModel) 19 | fun inject(sliderActivityViewModel: SliderActivityViewModel) 20 | fun inject(splashActivityViewModel: SplashActivityViewModel) 21 | fun inject(mainFragmentViewModel: MainFragmentViewModel) 22 | fun inject(settingsFragmentViewModel: SettingsFragmentViewModel) 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_app_settings.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/slider/adapter/ViewPagerAdapter.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.slider.adapter 2 | 3 | import android.content.Context 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.viewpager.widget.PagerAdapter 8 | import mustafaozhan.github.com.androcat.R 9 | 10 | class ViewPagerAdapter(var context: Context) : PagerAdapter() { 11 | 12 | private var layouts = intArrayOf( 13 | R.layout.slide_intro, 14 | R.layout.slide_dark_mode, 15 | R.layout.slide_bug_report, 16 | R.layout.slide_disable_ads 17 | ) 18 | 19 | override fun instantiateItem(container: ViewGroup, position: Int): View { 20 | val layoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as? LayoutInflater 21 | val view = layoutInflater?.inflate(layouts[position], container, false) 22 | container.addView(view) 23 | return view ?: View(context) 24 | } 25 | 26 | override fun getCount(): Int { 27 | return layouts.size 28 | } 29 | 30 | override fun isViewFromObject(view: View, obj: Any): Boolean { 31 | return view === obj 32 | } 33 | 34 | override fun destroyItem(container: ViewGroup, position: Int, obj: Any) { 35 | val view = obj as? View 36 | container.removeView(view) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/tools/DataManager.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.tools 2 | 3 | import mustafaozhan.github.com.androcat.base.api.github.GitHubApiHelper 4 | import org.joda.time.Instant 5 | import javax.inject.Inject 6 | import javax.inject.Singleton 7 | 8 | /** 9 | * Created by Mustafa Ozhan on 2018-07-22. 10 | */ 11 | @Singleton 12 | class DataManager @Inject 13 | constructor(private val generalSharedPreferences: GeneralSharedPreferences) { 14 | 15 | @Inject 16 | lateinit var gitHubApiHelper: GitHubApiHelper 17 | 18 | fun loadUser() = generalSharedPreferences.loadUser() 19 | 20 | fun updateUser(username: String? = null, isLoggedIn: Boolean? = null, token: String? = null) = 21 | generalSharedPreferences.updateUser(username, isLoggedIn, token) 22 | 23 | fun loadSettings() = generalSharedPreferences.loadSettings() 24 | 25 | fun updateSettings( 26 | darkMode: Boolean? = null, 27 | sliderShown: Boolean? = null, 28 | isNotificationOn: Boolean? = null, 29 | adFreeActivatedDate: Instant? = null 30 | ) = generalSharedPreferences.updateSettings( 31 | darkMode = darkMode, 32 | sliderShown = sliderShown, 33 | isNotificationOn = isNotificationOn, 34 | adFreeActivatedDate = adFreeActivatedDate 35 | ) 36 | 37 | fun getNotifications() = gitHubApiHelper.gitHubApiServices.getNotifications(true) 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/BaseViewModel.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base 2 | 3 | import androidx.lifecycle.ViewModel 4 | import mustafaozhan.github.com.androcat.application.Application 5 | import mustafaozhan.github.com.androcat.dagger.component.ViewModelComponent 6 | import mustafaozhan.github.com.androcat.tools.DataManager 7 | import org.joda.time.Duration 8 | import org.joda.time.Instant 9 | import javax.inject.Inject 10 | 11 | /** 12 | * Created by Mustafa Ozhan on 2018-07-22. 13 | */ 14 | abstract class BaseViewModel : ViewModel() { 15 | 16 | companion object { 17 | const val NUMBER_OF_HOURS = 24 18 | } 19 | 20 | protected val viewModelComponent: ViewModelComponent by lazy { 21 | Application.instance.component.viewModelComponent() 22 | } 23 | 24 | @Inject 25 | lateinit var dataManager: DataManager 26 | 27 | init { 28 | @Suppress("LeakingThis") 29 | inject() 30 | } 31 | 32 | protected abstract fun inject() 33 | 34 | open fun getSettings() = dataManager.loadSettings() 35 | 36 | open fun updateSettings( 37 | darkMode: Boolean? = null, 38 | sliderShown: Boolean? = null, 39 | isNotificationOn: Boolean? = null 40 | ) = dataManager.updateSettings(darkMode, sliderShown, isNotificationOn) 41 | 42 | open fun isRewardExpired() = dataManager.loadSettings().adFreeActivatedDate?.let { 43 | Duration(it, Instant.now()).standardHours > NUMBER_OF_HOURS 44 | } ?: true 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/application/Application.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.application 2 | 3 | import android.content.Context 4 | import androidx.multidex.MultiDexApplication 5 | import com.crashlytics.android.Crashlytics 6 | import com.crashlytics.android.core.CrashlyticsCore 7 | import com.google.firebase.analytics.FirebaseAnalytics 8 | import io.fabric.sdk.android.Fabric 9 | import mustafaozhan.github.com.androcat.BuildConfig 10 | import mustafaozhan.github.com.androcat.dagger.component.ApplicationComponent 11 | import mustafaozhan.github.com.androcat.dagger.component.DaggerApplicationComponent 12 | import mustafaozhan.github.com.androcat.dagger.module.ApplicationModule 13 | 14 | /** 15 | * Created by Mustafa Ozhan on 2018-07-22. 16 | */ 17 | class Application : MultiDexApplication() { 18 | companion object { 19 | lateinit var instance: Application 20 | 21 | fun get(context: Context): Application? { 22 | return context.applicationContext as? Application 23 | } 24 | } 25 | 26 | override fun onCreate() { 27 | super.onCreate() 28 | instance = this 29 | if (!BuildConfig.DEBUG) { 30 | FirebaseAnalytics.getInstance(this) 31 | } 32 | val core = CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build() 33 | Fabric.with(this, Crashlytics.Builder().core(core).build()) 34 | } 35 | 36 | val component: ApplicationComponent by lazy { 37 | DaggerApplicationComponent.builder() // will be auto generated after build 38 | .applicationModule(ApplicationModule(this)).build() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/BaseSharedPreferences.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base 2 | 3 | import android.content.Context 4 | import android.content.SharedPreferences 5 | import mustafaozhan.github.com.androcat.application.Application 6 | 7 | /** 8 | * Created by Mustafa Ozhan on 2018-07-22. 9 | */ 10 | abstract class BaseSharedPreferences { 11 | 12 | protected abstract val preferencesName: String 13 | 14 | protected fun getStringEntry(key: String, defaultValue: String = ""): String? { 15 | return getSharedPreferences().getString(key, defaultValue) 16 | } 17 | 18 | protected fun setStringEntry(key: String, value: String) { 19 | val prefsEditor = getPreferencesEditor() 20 | prefsEditor.putString(key, value) 21 | prefsEditor.commit() 22 | } 23 | 24 | protected fun setBooleanEntry(key: String, value: Boolean) { 25 | getPreferencesEditor().putBoolean(key, value).commit() 26 | } 27 | 28 | protected fun getBooleanEntry(key: String, defaultValue: Boolean = false): Boolean { 29 | return getSharedPreferences().getBoolean(key, defaultValue) 30 | } 31 | 32 | protected fun deleteEntry(key: String) { 33 | getPreferencesEditor().remove(key).commit() 34 | } 35 | 36 | private fun getPreferencesEditor(): SharedPreferences.Editor { 37 | 38 | val prefs = Application.instance.getSharedPreferences(preferencesName, Context.MODE_PRIVATE) 39 | return prefs.edit() 40 | } 41 | 42 | private fun getSharedPreferences(): SharedPreferences { 43 | return Application.instance.getSharedPreferences(preferencesName, Context.MODE_PRIVATE) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/assets/normalMode.js: -------------------------------------------------------------------------------- 1 | javascript: ( 2 | function() { 3 | 4 | var css = ""; 5 | 6 | var issuesNavBarName = "reponav-wrapper reponav-small d-lg-none"; 7 | var gitHubNavBarName = "position-relative js-header-wrapper "; 8 | var projectButton = "d-flex d-sm-none position-fixed bottom-0 width-full border-top bg-white p-3 box-shadow-large js-project-small-footer"; 9 | 10 | var head = document.getElementsByTagName("head")[0]; 11 | var body = document.getElementsByTagName("body")[0]; 12 | var style = document.createElement("style"); 13 | 14 | style.type = "text/css"; 15 | if (style.styleSheet) { 16 | style.styleSheet.cssText = css; 17 | } else { 18 | style.appendChild(document.createTextNode(css)); 19 | } 20 | 21 | if (document.getElementsByClassName(gitHubNavBarName)[0]) { 22 | document.getElementsByClassName(gitHubNavBarName)[0] 23 | .style 24 | .display = "none"; 25 | } 26 | if (document.getElementsByClassName(issuesNavBarName)[0]) { 27 | document.getElementsByClassName(issuesNavBarName)[0] 28 | .style 29 | .display = "none"; 30 | } 31 | if (document.getElementsByClassName(projectButton)[0]) { 32 | document.getElementsByClassName(projectButton)[0] 33 | .style 34 | .marginBottom = "55px"; 35 | document.body.style.marginBottom="150px"; 36 | } else { 37 | document.body.style.marginBottom="55px"; 38 | } 39 | 40 | head.appendChild(style); 41 | body.appendChild(style); 42 | 43 | }()); -------------------------------------------------------------------------------- /app/src/main/res/layout/slide_dark_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 19 | 20 | 26 | 27 | 34 | 35 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/java/mustafaozhan/github/com/androcat/base/api/github/GitHubApiHelper.kt: -------------------------------------------------------------------------------- 1 | package mustafaozhan.github.com.androcat.base.api.github 2 | 3 | import mustafaozhan.github.com.androcat.R 4 | import mustafaozhan.github.com.androcat.base.api.BaseApiHelper 5 | import mustafaozhan.github.com.androcat.tools.GeneralSharedPreferences 6 | import okhttp3.Credentials 7 | import okhttp3.Interceptor 8 | import okhttp3.OkHttpClient 9 | import okhttp3.Request 10 | import java.util.concurrent.TimeUnit 11 | import javax.inject.Inject 12 | import javax.inject.Singleton 13 | 14 | @Singleton 15 | class GitHubApiHelper @Inject 16 | constructor() : BaseApiHelper() { 17 | 18 | companion object { 19 | const val TIME_OUT: Long = 500 20 | const val HEADER_AUTHORIZATION = "Authorization" 21 | } 22 | 23 | val gitHubApiServices: GitHubApiServices by lazy { initGitHubApiServices() } 24 | 25 | private fun initGitHubApiServices(): GitHubApiServices { 26 | val clientBuilder = OkHttpClient.Builder() 27 | .readTimeout(TIME_OUT, TimeUnit.MILLISECONDS) 28 | .connectTimeout(TIME_OUT, TimeUnit.MILLISECONDS) 29 | clientBuilder.addInterceptor { 30 | it.proceed(createInterceptorRequest(it)) 31 | } 32 | val endpoint = getString(R.string.github_api) 33 | val retrofit = initRxRetrofit(endpoint, clientBuilder.build()) 34 | return retrofit.create(GitHubApiServices::class.java) 35 | } 36 | 37 | private fun createInterceptorRequest(chain: Interceptor.Chain): Request { 38 | val credentials: String 39 | GeneralSharedPreferences().loadUser().apply { 40 | credentials = Credentials.basic(username.toString(), token.toString()) 41 | } 42 | val original = chain.request() 43 | val builder = original.newBuilder() 44 | .header(HEADER_AUTHORIZATION, credentials) 45 | return builder.build() 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_slider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 21 | 22 | 29 | 30 | 36 | 37 |