convert AboutActivity to kotlin

This commit is contained in:
Felix 2017-11-25 00:13:58 +01:00
parent fbf9ae983a
commit f202012431
7 changed files with 1253 additions and 50 deletions

View file

@ -55,6 +55,9 @@ android {
dependencies {
implementation 'de.nicidienase.chaosflix:common:1.3-SNAPSHOT'
implementation('com.mikepenz:aboutlibraries:6.0.1@aar') {
transitive = true
}
implementation 'com.android.support:multidex:1.0.2'
implementation "com.android.support:support-v4:${rootProject.ext.supportLibraryVersion}"

View file

@ -1,38 +0,0 @@
package de.nicidienase.chaosflix.touch.activities;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.FrameLayout;
import de.nicidienase.chaosflix.R;
import mehdi.sakout.aboutpage.AboutPage;
import mehdi.sakout.aboutpage.Element;
public class AboutActivity extends AppCompatActivity {
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("About Chaosflix");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
View aboutView = new AboutPage(this).setImage(R.drawable.icon_notext_144x144)
.setDescription("This is Chaosflix!")
.addItem(new Element().setTitle("Title"))
.addItem(new Element().setTitle("Version 0.2.4"))
.addPlayStore("de.nicidienase.chaosflix")
.addGitHub("nicidienase/chaosflix")
.create();
FrameLayout frame = findViewById(R.id.container);
frame.addView(aboutView);
}
}

View file

@ -0,0 +1,39 @@
package de.nicidienase.chaosflix.touch.activities
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.Toolbar
import com.mikepenz.aboutlibraries.LibsBuilder
import com.mikepenz.aboutlibraries.ui.LibsFragment
import com.mikepenz.aboutlibraries.ui.LibsSupportFragment
import de.nicidienase.chaosflix.R
class AboutActivity : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_about)
val toolbar = findViewById<Toolbar>(R.id.toolbar)
toolbar.title = "About Chaosflix"
setSupportActionBar(toolbar)
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
// val aboutView = AboutPage(this).setImage(R.drawable.icon_notext_144x144)
// .setDescription(resources.getString(R.string.about_description))
// .addItem(Element().setTitle("Version ${BuildConfig.VERSION_NAME}"))
// .addPlayStore("de.nicidienase.chaosflix")
// .addGitHub("nicidienase/chaosflix")
// .create()
// val frame = findViewById<FrameLayout>(R.id.container)
// frame.addView(aboutView)
val aboutView: LibsSupportFragment = LibsBuilder()
.supportFragment()
supportFragmentManager.beginTransaction()
.replace(R.id.container,aboutView)
.commit()
}
}

View file

@ -1,15 +1,19 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="de.nicidienase.chaosflix.touch.activities.AboutActivity">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<include layout="@layout/toolbar"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="de.nicidienase.chaosflix.touch.activities.AboutActivity">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<include layout="@layout/toolbar"/>
</LinearLayout>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</layout>

View file

@ -0,0 +1,52 @@
0:47 play-services-oss-licenses
48:46 multiline-collapsingtoolbar
95:47 play-services-basement
143:731 UTF
875:2500 zlib
3376:19442 ICU4C
22819:11358 CCTZ
34178:680 STL
34859:1602 JSR 305
36462:1732 Protobuf Nano
38195:1481 darts_clone
39677:243 tz database
39921:1558 RE2
41480:3182 PCRE
44663:11358 safeparcel
57159:46 design
57206:46 support-v4
57711:46 appcompat-v7
57253:46 recyclerview-v7
57899:46 transition
58040:46 support-fragment
58134:46 support-core-utils
57946:46 animated-vector-drawable
57993:46 support-vector-drawable
58087:46 support-core-ui
57852:46 support-media-compat
58181:46 support-compat
58795:46 support-annotations
58228:46 runtime
58322:46 common
58654:46 compiler
58701:46 baseLibrary
56868:39 juniversalchardet
56908:46 adapters
56955:46 library
57002:54 stetho-okhttp3
57057:54 stetho
57112:46 multidex
57300:46 cardview-v7
57347:46 extensions
57394:46 common-java8
57441:46 rxjava2
57535:46 kotlin-reflect
57582:34 android-about-page
57617:46 rxandroid
57664:46 rxjava
57758:46 jsr305
58369:46 db-framework
58416:46 db
58510:49 reactive-streams
58560:46 annotations
58748:46 javapoet

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Chaosflix</string>
<string name="title">title</string>
<string name="subtitle">subtitle</string>
<string name="thumbnail">thumbnail</string>
@ -28,4 +30,6 @@
<string name="preferences">Preferences</string>
<string name="drawer_open">Drawer open</string>
<string name="drawer_close">Drawer closed</string>
<string name="about_description">TODO: Description</string>
<string name="about_title">Chaosflix</string>
</resources>