Merge DonationActivity to AboutActivity

This commit is contained in:
topjohnwu 2019-01-21 17:14:48 -05:00
parent 00f4242fa4
commit d73127b175
10 changed files with 70 additions and 98 deletions

View File

@ -65,6 +65,7 @@ dependencies {
def androidXVersion = "1.0.0"
implementation 'androidx.core:core:1.0.1'
fullImplementation 'androidx.constraintlayout:constraintlayout:1.1.3'
fullImplementation 'androidx.appcompat:appcompat:1.0.2'
fullImplementation "androidx.preference:preference:${androidXVersion}"
fullImplementation "androidx.recyclerview:recyclerview:${androidXVersion}"

View File

@ -9,7 +9,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:name="a.q"
android:name="a.e"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">
@ -33,9 +33,6 @@
<activity
android:name="a.d"
android:theme="@style/AppTheme.NoDrawer" />
<activity
android:name="a.e"
android:theme="@style/AppTheme.NoDrawer"/>
<activity
android:name="a.f"
android:configChanges="keyboardHidden|orientation|screenSize"

View File

@ -1,7 +1,7 @@
package a;
import com.topjohnwu.magisk.DonationActivity;
import com.topjohnwu.core.App;
public class e extends DonationActivity {
public class e extends App {
/* stub */
}

View File

@ -1,7 +0,0 @@
package a;
import com.topjohnwu.core.App;
public class q extends App {
/* stub */
}

View File

@ -27,6 +27,8 @@ public class AboutActivity extends BaseActivity {
@BindView(R.id.app_source_code) AboutCardRow appSourceCode;
@BindView(R.id.support_thread) AboutCardRow supportThread;
@BindView(R.id.follow_twitter) AboutCardRow twitter;
@BindView(R.id.paypal) AboutCardRow paypal;
@BindView(R.id.patreon) AboutCardRow patreon;
@Override
public int getDarkTheme() {
@ -66,6 +68,8 @@ public class AboutActivity extends BaseActivity {
appSourceCode.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.SOURCE_CODE_URL)));
supportThread.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.XDA_THREAD)));
twitter.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.TWITTER_URL)));
paypal.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.PAYPAL_URL)));
patreon.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.PATREON_URL)));
setFloating();
}

View File

@ -14,11 +14,10 @@ public class ClassMap {
private static Map<Class, Class> classMap = new HashMap<>();
static {
classMap.put(App.class, a.q.class);
classMap.put(App.class, a.e.class);
classMap.put(MainActivity.class, a.b.class);
classMap.put(SplashActivity.class, a.c.class);
classMap.put(AboutActivity.class, a.d.class);
classMap.put(DonationActivity.class, a.e.class);
classMap.put(FlashActivity.class, a.f.class);
classMap.put(UpdateCheckService.class, a.g.class);
classMap.put(GeneralReceiver.class, a.h.class);

View File

@ -1,45 +0,0 @@
package com.topjohnwu.magisk;
import android.net.Uri;
import android.os.Bundle;
import com.topjohnwu.core.Const;
import com.topjohnwu.magisk.components.AboutCardRow;
import com.topjohnwu.magisk.components.BaseActivity;
import com.topjohnwu.magisk.utils.AppUtils;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import butterknife.BindView;
public class DonationActivity extends BaseActivity {
@BindView(R.id.toolbar) Toolbar toolbar;
@BindView(R.id.paypal) AboutCardRow paypal;
@BindView(R.id.patreon) AboutCardRow patreon;
@Override
public int getDarkTheme() {
return R.style.AppTheme_NoDrawer_Dark;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donation);
new DonationActivity_ViewBinding(this);
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(view -> finish());
ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setTitle(R.string.donation);
ab.setDisplayHomeAsUpEnabled(true);
}
paypal.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.PAYPAL_URL)));
patreon.setOnClickListener(v -> AppUtils.openLink(this, Uri.parse(Const.Url.PATREON_URL)));
}
}

View File

@ -158,9 +158,6 @@ public class MainActivity extends BaseActivity
case "about":
itemId = R.id.app_about;
break;
case "donation":
itemId = R.id.donation;
break;
}
}
navigate(itemId);
@ -197,10 +194,6 @@ public class MainActivity extends BaseActivity
startActivity(new Intent(this, ClassMap.get(AboutActivity.class)));
mDrawerItem = bak;
break;
case R.id.donation:
startActivity(new Intent(this, ClassMap.get(DonationActivity.class)));
mDrawerItem = bak;
break;
}
}

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@ -7,8 +9,6 @@
<include layout="@layout/toolbar"/>
<ScrollView
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="8dp"
@ -20,6 +20,64 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
style="?attr/cardStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardUseCompatPadding="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="72dp"
android:layout_height="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
app:layout_constraintBottom_toTopOf="@+id/paypal"
app:layout_constraintEnd_toStartOf="@+id/textView"
app:layout_constraintTop_toTopOf="@+id/textView"
app:srcCompat="@drawable/ic_logo" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<a.l
android:id="@+id/paypal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="@drawable/ic_paypal"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:text="PayPal" />
<a.l
android:id="@+id/patreon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="@drawable/ic_patreon"
app:layout_constraintTop_toBottomOf="@+id/paypal"
app:text="Patreon" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -32,28 +90,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="72dp"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
app:srcCompat="@drawable/ic_logo"
android:layout_width="72dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"/>
</LinearLayout>
<a.l
android:id="@+id/app_version_info"
android:layout_width="match_parent"

View File

@ -64,12 +64,6 @@
android:icon="@drawable/ic_info_outline"
android:title="@string/about"/>
<item
android:checkable="false"
android:id="@+id/donation"
android:icon="@drawable/ic_attach_money"
android:title="@string/donation"/>
</group>
</menu>