Replace licenseDialog

This commit is contained in:
NekoInverter 2020-03-03 16:29:54 +08:00
parent 93bbb75fb1
commit d2914f947d
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
5 changed files with 8 additions and 23 deletions

View File

@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
android {
compileSdkVersion 28
@ -43,5 +44,5 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.2.0-alpha01"
implementation 'com.annimon:stream:1.2.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0'
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
}

View File

@ -1,5 +1,6 @@
package org.meowcat.edxposed.manager;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
@ -10,15 +11,11 @@ import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.meowcat.edxposed.manager.util.NavUtil;
import de.psdev.licensesdialog.LicensesDialog;
import de.psdev.licensesdialog.licenses.ApacheSoftwareLicense20;
import de.psdev.licensesdialog.model.Notice;
import de.psdev.licensesdialog.model.Notices;
public class AboutActivity extends BaseActivity {
@Override
@ -67,7 +64,7 @@ public class AboutActivity extends BaseActivity {
} catch (PackageManager.NameNotFoundException ignored) {
}
licensesView.setOnClickListener(v12 -> createLicenseDialog());
licensesView.setOnClickListener(v12 -> startActivity(new Intent(this, OssLicensesMenuActivity.class)));
txtModuleSupport.setText(getString(R.string.support_modules_description,
getString(R.string.module_support)));
@ -89,18 +86,6 @@ public class AboutActivity extends BaseActivity {
v.setOnClickListener(v1 -> NavUtil.startURL(this, getString(url)));
}
private void createLicenseDialog() {
Notices notices = new Notices();
notices.addNotice(new Notice("sticky-headers-recyclerview", "https://github.com/timehop/sticky-headers-recyclerview", "timehop", new ApacheSoftwareLicense20()));
notices.addNotice(new Notice("libsu", "https://github.com/topjohnwu/libsu", "John Wu", new ApacheSoftwareLicense20()));
new LicensesDialog.Builder(this)
.setNotices(notices)
.setIncludeOwnLicense(true)
.build()
.show();
}
public void openLink(View view) {
NavUtil.startURL(this, view.getTag().toString());
}

View File

@ -12,7 +12,6 @@ import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@ -20,7 +19,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.SearchView;
@ -351,7 +349,7 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis
txtStatus.setText(mContext.getString(
R.string.download_status_installed, installedVersion));
//txtStatus.setTextColor(ThemeUtil.getThemeColor(mContext, R.attr.download_status_installed));
TypedArray typedArray = DownloadActivity.this.getTheme().obtainStyledAttributes(new int[] { android.R.attr.textColorSecondary });
TypedArray typedArray = DownloadActivity.this.getTheme().obtainStyledAttributes(new int[]{android.R.attr.textColorSecondary});
int textColor = typedArray.getColor(0, 0);
typedArray.recycle();
txtStatus.setTextColor(textColor);

View File

@ -34,7 +34,7 @@ public final class NavUtil {
public static void startURL(AppCompatActivity activity, Uri uri) {
CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder();
customTabsIntent.setShowTitle(true);
customTabsIntent.setToolbarColor(ContextCompat.getColor(activity, R.color.colorPrimary));
customTabsIntent.setToolbarColor(ContextCompat.getColor(activity, R.color.colorActionBar));
customTabsIntent.build().launchUrl(activity, uri);
}

View File

@ -8,6 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files