Skip to content

Commit f7d96db

Browse files
committed
-> build 16
1 parent ddfb70b commit f7d96db

File tree

15 files changed

+377
-28
lines changed

15 files changed

+377
-28
lines changed

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ext {
99
compile_sdk = 27
1010
target_sdk = 27
1111
build_tools = '27.0.3'
12-
version_code = 15
12+
version_code = 16
1313
version_name = '0.1.4'
1414

1515
annotations = '16.0.2'
@@ -48,6 +48,7 @@ android {
4848
archivesBaseName = "fantlab-${versionName}"
4949
buildConfigField "String", "REST_URL", '"https://api.fantlab.ru/"'
5050
buildConfigField "String", "API_VERSION", '"0.9.20"'
51+
resValue "string", "VERSION_NAME", "$versionName ($versionCode)"
5152
javaCompileOptions {
5253
annotationProcessorOptions {
5354
includeCompileClasspath false

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@
105105
android:configChanges="keyboard|orientation|screenSize"
106106
android:windowSoftInputMode="adjustResize"
107107
/>
108+
<activity
109+
android:name=".ui.modules.about.AboutActivity"
110+
android:configChanges="keyboard|orientation|screenSize"
111+
android:parentActivityName=".ui.modules.main.MainActivity"
112+
/>
113+
108114
<activity
109115
android:name="ru.fantlab.android.provider.parser.LinksParserActivity"
110116
android:configChanges="keyboard|orientation|screenSize"

app/src/main/kotlin/ru/fantlab/android/provider/scheme/SchemeParser.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object SchemeParser {
5353
}
5454
}
5555

56-
private fun openUrl(context: Context, url: String) {
56+
fun openUrl(context: Context, url: String) {
5757
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
5858
context.startActivity(browserIntent)
5959
}

app/src/main/kotlin/ru/fantlab/android/ui/base/MainNavDrawer.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import android.view.ViewGroup
1010
import ru.fantlab.android.R
1111
import ru.fantlab.android.data.dao.model.User
1212
import ru.fantlab.android.helper.PrefGetter
13+
import ru.fantlab.android.ui.modules.about.AboutActivity
1314
import ru.fantlab.android.ui.modules.authors.AuthorsActivity
1415
import ru.fantlab.android.ui.modules.awards.AwardsActivity
1516
import ru.fantlab.android.ui.modules.login.LoginActivity
@@ -88,12 +89,14 @@ class MainNavDrawer(val view: BaseActivity<*, *>, private val extraNav: Navigati
8889
R.id.settingsView -> {
8990
view.onOpenSettings()
9091
}
92+
R.id.aboutView -> {
93+
view.startActivity(Intent(view, AboutActivity::class.java))
94+
}
9195
R.id.profile -> userModel?.let {
9296
UserPagerActivity.startActivity(view, it.login, it.id, 0)
9397
}
9498
R.id.authors -> view.startActivity(Intent(view, AuthorsActivity::class.java))
9599
R.id.awards -> view.startActivity(Intent(view, AwardsActivity::class.java))
96-
//item.itemId == R.id.about -> view.startActivity(Intent(view, AboutActivity::class.java))
97100
}
98101
}
99102
}, 250)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package ru.fantlab.android.ui.modules.about
2+
3+
import android.content.Context
4+
import android.content.Intent
5+
import android.net.Uri
6+
import android.os.Bundle
7+
import android.view.View
8+
import kotlinx.android.synthetic.main.activity_about.*
9+
import ru.fantlab.android.R
10+
import ru.fantlab.android.provider.scheme.SchemeParser
11+
import ru.fantlab.android.ui.base.BaseActivity
12+
13+
class AboutActivity : BaseActivity<AboutMvp.View, AboutPresenter>(), AboutMvp.View {
14+
15+
override fun isTransparent(): Boolean = false
16+
override fun providePresenter(): AboutPresenter = AboutPresenter()
17+
override fun layout(): Int = R.layout.activity_about
18+
override fun canBack(): Boolean = true
19+
20+
override fun onCreate(savedInstanceState: Bundle?) {
21+
super.onCreate(savedInstanceState)
22+
title = getString(R.string.app_name)
23+
24+
developersView.setOnClickListener(this)
25+
forumView.setOnClickListener(this)
26+
githubView.setOnClickListener(this)
27+
versionView.setOnClickListener(this)
28+
}
29+
30+
override fun onClick(v: View?) {
31+
when (v?.id) {
32+
R.id.developersView -> toTelegram()
33+
R.id.forumView -> SchemeParser.openUrl(this, "https://fantlab.ru/forum/forum2page1/topic10144page1")
34+
R.id.githubView -> SchemeParser.openUrl(this, "https://github.com/FantLab/FantLab-Android")
35+
R.id.versionView -> {}
36+
}
37+
}
38+
39+
private fun toTelegram() {
40+
val telegram = Intent(Intent.ACTION_VIEW)
41+
telegram.data = Uri.parse("tg:resolve?domain=ilya_kokhan")
42+
startActivity(Intent.createChooser(telegram, getString(R.string.send_with)))
43+
}
44+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package ru.fantlab.android.ui.modules.about
2+
3+
import ru.fantlab.android.ui.base.mvp.BaseMvp
4+
5+
interface AboutMvp {
6+
7+
interface View : BaseMvp.View, android.view.View.OnClickListener
8+
9+
interface Presenter : BaseMvp.Presenter
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package ru.fantlab.android.ui.modules.about
2+
3+
import ru.fantlab.android.ui.base.mvp.presenter.BasePresenter
4+
5+
class AboutPresenter : BasePresenter<AboutMvp.View>(), AboutMvp.Presenter
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
<path
7+
android:fillColor="?icon_color"
8+
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
9+
</vector>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="24dp"
4+
android:height="24dp"
5+
android:viewportHeight="24"
6+
android:viewportWidth="24">
7+
<path
8+
android:fillColor="?icon_color"
9+
android:pathData="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z"/>
10+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
<path
7+
android:fillColor="?icon_color"
8+
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
9+
</vector>

0 commit comments

Comments
 (0)