Fix issue #30
This commit is contained in:
parent
df9fd63b70
commit
55d49c7249
|
@ -39,6 +39,64 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<!-- SHORTENED URLs -->
|
||||
<data android:host="t.co" />
|
||||
<data android:host="nyti.ms" />
|
||||
<data android:host="bit.ly" />
|
||||
<data android:host="tinyurl.com" />
|
||||
<data android:host="goo.gl" />
|
||||
<data android:host="ow.ly" />
|
||||
<data android:host="bl.ink" />
|
||||
<data android:host="buff.ly" />
|
||||
|
||||
<!-- INSTAGRAM URLs -->
|
||||
<data android:host="instagram.com" />
|
||||
<data android:host="www.instagram.com" />
|
||||
<data android:host="m.instagram.com" />
|
||||
|
||||
|
||||
<!-- TWITTER URLs -->
|
||||
<data android:host="mobile.twitter.com" />
|
||||
<data android:host="www.twitter.com" />
|
||||
<data android:host="twitter.com" />
|
||||
<data android:host="pbs.twimg.com" />
|
||||
<data android:host="pic.twitter.com" />
|
||||
|
||||
<!-- YOUTUBE URLs -->
|
||||
<data android:host="www.youtube.com" />
|
||||
<data android:host="m.youtube.com" />
|
||||
<data android:host="youtube.com" />
|
||||
<data android:host="youtu.be" />
|
||||
<data android:host="youtube-nocookie.com" />
|
||||
|
||||
|
||||
<!-- INVIDIOUS INSTANCES -->
|
||||
<data android:host="invidio.us" />
|
||||
<data android:host="invidious.snopyta.org" />
|
||||
<data android:host="invidiou.sh" />
|
||||
<data android:host="invidious.toot.koeln" />
|
||||
<data android:host="invidious.ggc-project.de" />
|
||||
<data android:host="invidious.13ad.de" />
|
||||
<data android:host="yewtu.be" />
|
||||
|
||||
<!-- NITTER INSTANCES -->
|
||||
<data android:host="nitter.net" />
|
||||
<data android:host="nitter.snopyta.org" />
|
||||
<data android:host="nitter.42l.fr" />
|
||||
<data android:host="nitter.nixnet.services" />
|
||||
<data android:host="nitter.13ad.de" />
|
||||
<data android:host="tw.openalgeria.org" />
|
||||
<data android:host="nitter.pussthecat.org" />
|
||||
<data android:host="nitter.mastodont.cat" />
|
||||
<data android:host="nitter.dark.fail" />
|
||||
<data android:host="nitter.tedomum.net" />
|
||||
|
||||
<!-- BIBLIOGRAM INSTANCES -->
|
||||
<data android:host="bibliogram.art" />
|
||||
<data android:host="bibliogram.snopyta.org" />
|
||||
<data android:host="bibliogram.dsrev.ru" />
|
||||
<data android:host="bibliogram.pussthecat.org" />
|
||||
|
||||
<data android:host="*" />
|
||||
<data android:pathPattern=".*" />
|
||||
<data android:scheme="https" />
|
||||
|
@ -50,10 +108,85 @@
|
|||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<!-- SHORTENED URLs -->
|
||||
<data android:host="t.co" />
|
||||
<data android:host="nyti.ms" />
|
||||
<data android:host="bit.ly" />
|
||||
<data android:host="tinyurl.com" />
|
||||
<data android:host="goo.gl" />
|
||||
<data android:host="ow.ly" />
|
||||
<data android:host="bl.ink" />
|
||||
<data android:host="buff.ly" />
|
||||
|
||||
<!-- INSTAGRAM URLs -->
|
||||
<data android:host="instagram.com" />
|
||||
<data android:host="www.instagram.com" />
|
||||
<data android:host="m.instagram.com" />
|
||||
|
||||
<!-- TWITTER URLs -->
|
||||
<data android:host="mobile.twitter.com" />
|
||||
<data android:host="www.twitter.com" />
|
||||
<data android:host="twitter.com" />
|
||||
<data android:host="pbs.twimg.com" />
|
||||
|
||||
<!-- YOUTUBE URLs -->
|
||||
<data android:host="www.youtube.com" />
|
||||
<data android:host="m.youtube.com" />
|
||||
<data android:host="youtube.com" />
|
||||
<data android:host="youtu.be" />
|
||||
<data android:host="youtube-nocookie.com" />
|
||||
|
||||
|
||||
|
||||
<data android:host="*" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- MAPS URLs -->
|
||||
<!-- /maps/ -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:host="*" />
|
||||
<data android:pathPattern="/maps/place/.*" />
|
||||
<data android:scheme="https" />
|
||||
<data android:scheme="http" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data
|
||||
android:host="*"
|
||||
android:mimeType="text/plain"
|
||||
android:pathPattern="/maps/place/.*" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- AMP URLs -->
|
||||
<!-- /amp/ -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:host="*" />
|
||||
<data android:pathPattern="/amp/s/.*" />
|
||||
<data android:scheme="https" />
|
||||
<data android:scheme="http" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data
|
||||
android:host="*"
|
||||
android:mimeType="text/plain"
|
||||
android:pathPattern="/amp/s/.*" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.AppsPickerActivity"
|
||||
|
@ -73,6 +206,11 @@
|
|||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".activities.DefaultAppActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".activities.WebviewPlayerActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.nitterizeme.activities;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
@ -31,9 +30,7 @@ import android.widget.Toast;
|
|||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.nitterizeme.R;
|
||||
import app.fedilab.nitterizeme.adapters.AppPickerAdapter;
|
||||
|
@ -42,11 +39,8 @@ import app.fedilab.nitterizeme.helpers.Utils;
|
|||
import app.fedilab.nitterizeme.sqlite.DefaultAppDAO;
|
||||
import app.fedilab.nitterizeme.sqlite.Sqlite;
|
||||
|
||||
import static app.fedilab.nitterizeme.activities.CheckAppActivity.invidious_instances;
|
||||
import static app.fedilab.nitterizeme.helpers.Utils.KILL_ACTIVITY;
|
||||
import static app.fedilab.nitterizeme.helpers.Utils.URL_APP_PICKER;
|
||||
import static app.fedilab.nitterizeme.helpers.Utils.getPackageInfo;
|
||||
import static app.fedilab.nitterizeme.helpers.Utils.isAppInstalled;
|
||||
|
||||
|
||||
public class AppsPickerActivity extends Activity {
|
||||
|
@ -78,19 +72,13 @@ public class AppsPickerActivity extends Activity {
|
|||
sendBroadcast(stopMainActivity);
|
||||
|
||||
Intent delegate = new Intent(Intent.ACTION_VIEW);
|
||||
delegate.setDataAndType(Uri.parse(url), "text/html");
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
delegate.setData(Uri.parse(url));
|
||||
|
||||
List<ResolveInfo> activities;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
||||
activities = getPackageManager().queryIntentActivities(delegate, PackageManager.MATCH_ALL);
|
||||
} else {
|
||||
activities = getPackageManager().queryIntentActivities(delegate, 0);
|
||||
}
|
||||
List<ResolveInfo> activities = getPackageManager().queryIntentActivities(delegate, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
RelativeLayout blank = findViewById(R.id.blank);
|
||||
blank.setOnClickListener(v -> finish());
|
||||
|
||||
String thisPackageName = getApplicationContext().getPackageName();
|
||||
ArrayList<String> packages = new ArrayList<>();
|
||||
List<AppPicker> appPickers = new ArrayList<>();
|
||||
|
@ -112,21 +100,9 @@ public class AppsPickerActivity extends Activity {
|
|||
}
|
||||
i++;
|
||||
}
|
||||
if (isAppInstalled(AppsPickerActivity.this, "org.schabi.newpipe")
|
||||
&& Arrays.asList(invidious_instances).contains(Objects.requireNonNull(Uri.parse(url)).getHost())
|
||||
&& !packages.contains("org.schabi.newpipe")) {
|
||||
PackageInfo packageInfo = getPackageInfo(AppsPickerActivity.this, "org.schabi.newpipe");
|
||||
if (packageInfo != null) {
|
||||
AppPicker appPicker = new AppPicker();
|
||||
appPicker.setIcon(packageInfo.applicationInfo.loadIcon(getPackageManager()));
|
||||
appPicker.setName(String.valueOf(packageInfo.applicationInfo.loadLabel(getPackageManager())));
|
||||
appPicker.setPackageName(packageInfo.applicationInfo.packageName);
|
||||
appPickers.add(appPicker);
|
||||
packages.add("org.schabi.newpipe");
|
||||
}
|
||||
}
|
||||
String defaultApp = new DefaultAppDAO(AppsPickerActivity.this, db).getDefault(packages);
|
||||
|
||||
|
||||
if (defaultApp != null) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
intent.setPackage(defaultApp);
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
package app.fedilab.nitterizeme.activities;
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of UntrackMe
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* UntrackMe is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import app.fedilab.nitterizeme.R;
|
||||
import app.fedilab.nitterizeme.adapters.DefaultAppAdapter;
|
||||
import app.fedilab.nitterizeme.entities.DefaultApp;
|
||||
import app.fedilab.nitterizeme.helpers.Utils;
|
||||
import app.fedilab.nitterizeme.sqlite.DefaultAppDAO;
|
||||
import app.fedilab.nitterizeme.sqlite.Sqlite;
|
||||
|
||||
|
||||
public class DefaultAppActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_default_app);
|
||||
|
||||
|
||||
setTitle(R.string.default_apps);
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
RecyclerView list_apps = findViewById(R.id.list_apps);
|
||||
final LinearLayoutManager mLayoutManager;
|
||||
mLayoutManager = new LinearLayoutManager(DefaultAppActivity.this);
|
||||
list_apps.setLayoutManager(mLayoutManager);
|
||||
list_apps.setNestedScrollingEnabled(false);
|
||||
|
||||
ArrayList<DefaultApp> appInfos = getAppInfo();
|
||||
DefaultAppAdapter defaultAppAdapter = new DefaultAppAdapter(appInfos);
|
||||
list_apps.setAdapter(defaultAppAdapter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get default app set inside the application for opening links
|
||||
*
|
||||
* @return ArrayList<DefaultApp>
|
||||
*/
|
||||
private ArrayList<DefaultApp> getAppInfo() {
|
||||
ArrayList<DefaultApp> appInfos = new ArrayList<>();
|
||||
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
ArrayList<String> packageName = new DefaultAppDAO(DefaultAppActivity.this, db).getDefault();
|
||||
for (String p : packageName) {
|
||||
DefaultApp defaultApp = new DefaultApp();
|
||||
defaultApp.setApplicationInfo(Utils.getPackageInfo(DefaultAppActivity.this, p).applicationInfo);
|
||||
appInfos.add(defaultApp);
|
||||
}
|
||||
return appInfos;
|
||||
}
|
||||
|
||||
}
|
|
@ -19,6 +19,8 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
|
@ -33,11 +35,13 @@ import android.widget.TextView;
|
|||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.nitterizeme.R;
|
||||
|
@ -88,7 +92,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
||||
TextView current_instance_nitter = findViewById(R.id.current_instance_nitter);
|
||||
|
@ -138,7 +141,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
enable_invidious.setChecked(invidious_enabled);
|
||||
enable_bibliogram.setChecked(bibliogram_enabled);
|
||||
enable_osm.setChecked(osm_enabled);
|
||||
|
||||
ImageButton save_instance_nitter = findViewById(R.id.button_save_instance_nitter);
|
||||
ImageButton save_instance_invidious = findViewById(R.id.button_save_instance_invidious);
|
||||
ImageButton save_instance_bibliogram = findViewById(R.id.button_save_instance_bibliogram);
|
||||
|
@ -462,6 +464,10 @@ public class MainActivity extends AppCompatActivity {
|
|||
Intent intent = new Intent(MainActivity.this, AboutActivity.class);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else if (id == R.id.action_settings) {
|
||||
Intent intent = new Intent(MainActivity.this, DefaultAppActivity.class);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
@ -504,5 +510,14 @@ public class MainActivity extends AppCompatActivity {
|
|||
bibliogram_instance.setText(bibliogramHost);
|
||||
current_instance_bibliogram.setText(bibliogramHost);
|
||||
}
|
||||
|
||||
List<ResolveInfo> resolveInfos = getPackageManager().queryIntentActivities(new Intent(Intent.ACTION_VIEW, Uri.parse("https://fedilab.app")), PackageManager.MATCH_DEFAULT_ONLY);
|
||||
String thisPackageName = getApplicationContext().getPackageName();
|
||||
ConstraintLayout display_indications = findViewById(R.id.display_indications);
|
||||
if (resolveInfos.size() == 1 && resolveInfos.get(0).activityInfo.packageName.compareTo(thisPackageName) == 0) {
|
||||
display_indications.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
display_indications.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,9 +111,7 @@ public class TransformActivity extends Activity {
|
|||
Intent delegate = new Intent(Intent.ACTION_VIEW);
|
||||
delegate.setData(Uri.parse(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1)));
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
}
|
||||
forwardToBrowser(delegate);
|
||||
}
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
|
@ -166,10 +164,7 @@ public class TransformActivity extends Activity {
|
|||
if (transformedURL != null) {
|
||||
delegate.setData(Uri.parse(transformUrl(TransformActivity.this, url)));
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
forwardToBrowser(delegate);
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
}
|
||||
|
@ -185,10 +180,7 @@ public class TransformActivity extends Activity {
|
|||
if (transformedURL != null) {
|
||||
delegate.setData(Uri.parse(transformUrl(TransformActivity.this, url)));
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
forwardToBrowser(delegate);
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
}
|
||||
|
@ -205,10 +197,7 @@ public class TransformActivity extends Activity {
|
|||
if (transformedURL != null) {
|
||||
delegate.setData(Uri.parse(transformUrl(TransformActivity.this, url)));
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
forwardToBrowser(delegate);
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
}
|
||||
|
@ -227,10 +216,7 @@ public class TransformActivity extends Activity {
|
|||
if (transformedURL != null) {
|
||||
delegate.setData(Uri.parse(transformedURL));
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
forwardToBrowser(delegate);
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
}
|
||||
|
@ -244,10 +230,7 @@ public class TransformActivity extends Activity {
|
|||
if (transformedURL != null) {
|
||||
delegate.setData(Uri.parse(transformUrl(TransformActivity.this, url)));
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
forwardToBrowser(delegate);
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
package app.fedilab.nitterizeme.adapters;
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of UntrackMe
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* UntrackMe is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.nitterizeme.R;
|
||||
import app.fedilab.nitterizeme.entities.DefaultApp;
|
||||
import app.fedilab.nitterizeme.sqlite.DefaultAppDAO;
|
||||
import app.fedilab.nitterizeme.sqlite.Sqlite;
|
||||
|
||||
public class DefaultAppAdapter extends RecyclerView.Adapter {
|
||||
|
||||
private List<DefaultApp> defaultApps;
|
||||
|
||||
public DefaultAppAdapter(List<DefaultApp> packageNames) {
|
||||
this.defaultApps = packageNames;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int position) {
|
||||
Context context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(context);
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_default_app, parent, false));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
|
||||
DefaultApp defaultApp = defaultApps.get(viewHolder.getAdapterPosition());
|
||||
ViewHolder holder = (ViewHolder) viewHolder;
|
||||
Context context = holder.itemView.getContext();
|
||||
if (defaultApp.getApplicationInfo() != null) {
|
||||
Drawable icon = defaultApp.getApplicationInfo().loadIcon(context.getPackageManager());
|
||||
try {
|
||||
holder.app_icon.setImageDrawable(icon);
|
||||
} catch (Resources.NotFoundException e) {
|
||||
holder.app_icon.setImageResource(R.drawable.ic_android);
|
||||
}
|
||||
String app_name = context.getPackageManager().getApplicationLabel(defaultApp.getApplicationInfo()).toString();
|
||||
String app_package = defaultApp.getApplicationInfo().packageName;
|
||||
holder.app_name.setText(app_name);
|
||||
holder.app_package.setText(app_package);
|
||||
holder.delete.setOnClickListener(v -> {
|
||||
AlertDialog.Builder confirmDialog = new AlertDialog.Builder(context, R.style.AppThemeDialogDelete);
|
||||
confirmDialog.setMessage(context.getString(R.string.delete_app_from_default, app_name));
|
||||
confirmDialog.setIcon(R.mipmap.ic_launcher);
|
||||
confirmDialog.setPositiveButton(R.string.delete, (dialog, id) -> {
|
||||
SQLiteDatabase db = Sqlite.getInstance(context.getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
new DefaultAppDAO(context, db).removeApp(app_package);
|
||||
defaultApps.remove(defaultApp);
|
||||
notifyItemRemoved(i);
|
||||
dialog.dismiss();
|
||||
});
|
||||
confirmDialog.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||
AlertDialog alertDialog = confirmDialog.create();
|
||||
alertDialog.show();
|
||||
|
||||
});
|
||||
} else {
|
||||
holder.app_icon.setImageResource(R.drawable.ic_android);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return defaultApps.size();
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView app_icon, delete;
|
||||
TextView app_name, app_package;
|
||||
ConstraintLayout main_container;
|
||||
|
||||
ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
app_icon = itemView.findViewById(R.id.app_icon);
|
||||
delete = itemView.findViewById(R.id.delete);
|
||||
app_name = itemView.findViewById(R.id.app_name);
|
||||
app_package = itemView.findViewById(R.id.app_package);
|
||||
main_container = itemView.findViewById(R.id.main_container);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package app.fedilab.nitterizeme.entities;
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of UntrackMe
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* UntrackMe is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
public class DefaultApp {
|
||||
|
||||
private android.content.pm.ApplicationInfo ApplicationInfo;
|
||||
|
||||
public android.content.pm.ApplicationInfo getApplicationInfo() {
|
||||
return ApplicationInfo;
|
||||
}
|
||||
|
||||
public void setApplicationInfo(android.content.pm.ApplicationInfo applicationInfo) {
|
||||
ApplicationInfo = applicationInfo;
|
||||
}
|
||||
}
|
|
@ -348,6 +348,7 @@ public class Utils {
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public static boolean isAppInstalled(Context context, String packageName) {
|
||||
try {
|
||||
context.getPackageManager().getPackageInfo(packageName, 0);
|
||||
|
@ -362,6 +363,7 @@ public class Utils {
|
|||
*
|
||||
* @return PackageInfo
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public static PackageInfo getPackageInfo(Context context, String packageName) {
|
||||
PackageInfo packageInfo = null;
|
||||
try {
|
||||
|
@ -384,7 +386,24 @@ public class Utils {
|
|||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (String item : arrayList) {
|
||||
result.append("\"").append(item).append("\"").append(",");
|
||||
result.append(item).append(",");
|
||||
}
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an ArrayList to a string using coma
|
||||
*
|
||||
* @param arrayList ArrayList<String>
|
||||
* @return String
|
||||
*/
|
||||
public static String arrayToStringQuery(ArrayList<String> arrayList) {
|
||||
if (arrayList == null || arrayList.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (String item : arrayList) {
|
||||
result.append("'").append(item).append("'").append(",");
|
||||
}
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
@ -405,21 +424,10 @@ public class Utils {
|
|||
|
||||
|
||||
public static <T> ArrayList<T> union(ArrayList<T> list1, ArrayList<T> list2) {
|
||||
Set<T> set = new HashSet<T>();
|
||||
Set<T> set = new HashSet<>();
|
||||
set.addAll(list1);
|
||||
set.addAll(list2);
|
||||
return new ArrayList<T>(set);
|
||||
}
|
||||
|
||||
|
||||
public static <T> ArrayList<T> intersection(ArrayList<T> list1, ArrayList<T> list2) {
|
||||
ArrayList<T> list = new ArrayList<T>();
|
||||
for (T t : list1) {
|
||||
if (list2.contains(t)) {
|
||||
list.add(t);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
return new ArrayList<>(set);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public class DefaultAppDAO {
|
|||
public long insert(String packageName, ArrayList<String> concurrentPackages) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(Sqlite.COL_DEFAULT_PACKAGE, packageName.trim());
|
||||
concurrentPackages.remove(packageName);
|
||||
values.put(Sqlite.COL_CONCURRENT_PACKAGES, Utils.arrayToString(concurrentPackages));
|
||||
try {
|
||||
return db.insert(Sqlite.TABLE_DEFAULT_APPS, null, values);
|
||||
|
@ -82,7 +83,7 @@ public class DefaultAppDAO {
|
|||
|
||||
public String getDefault(ArrayList<String> packageNames) {
|
||||
try {
|
||||
Cursor c = db.query(Sqlite.TABLE_DEFAULT_APPS, null, Sqlite.COL_DEFAULT_PACKAGE + " IN ( " + Utils.arrayToString(packageNames) + ")", null, null, null, null, null);
|
||||
Cursor c = db.query(Sqlite.TABLE_DEFAULT_APPS, null, Sqlite.COL_DEFAULT_PACKAGE + " IN ( " + Utils.arrayToStringQuery(packageNames) + ")", null, null, null, null, null);
|
||||
return getBestMatchIfExists(c, packageNames);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -136,15 +137,17 @@ public class DefaultAppDAO {
|
|||
}
|
||||
ArrayList<String> concurrent = new ArrayList<>();
|
||||
while (c.moveToNext()) {
|
||||
String packageName = c.getString(c.getColumnIndex(Sqlite.COL_DEFAULT_PACKAGE));
|
||||
String packageName = c.getString(c.getColumnIndex(Sqlite.COL_CONCURRENT_PACKAGES));
|
||||
concurrent.addAll(Utils.stringToArray(packageName));
|
||||
}
|
||||
for (String conc : concurrent) {
|
||||
allPackages.remove(conc);
|
||||
}
|
||||
c.close();
|
||||
//Items will only returns concurrent for default apps.
|
||||
ArrayList<String> best = Utils.intersection(allPackages, concurrent);
|
||||
//The winner will be the one not in concurrent
|
||||
if (best.size() == 1) {
|
||||
return best.get(0);
|
||||
if (allPackages.size() == 1) {
|
||||
return allPackages.get(0);
|
||||
} else return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#FFFFFF"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
|
||||
</vector>
|
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
Binary file not shown.
After Width: | Height: | Size: 119 KiB |
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/red" />
|
||||
<corners android:radius="10dp" />
|
||||
<padding
|
||||
android:bottom="0dp"
|
||||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp" />
|
||||
</shape>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of UntrackMe
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* UntrackMe is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
-->
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
|
||||
tools:context=".activities.DefaultAppActivity">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list_apps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -32,11 +32,11 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/app_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimary"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
|
|
@ -638,7 +638,7 @@
|
|||
style="@style/containerCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/display_indications"
|
||||
app:layout_constraintTop_toBottomOf="@id/osm_container">
|
||||
|
||||
<Button
|
||||
|
@ -688,6 +688,106 @@
|
|||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/display_indications"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rounded_error"
|
||||
android:padding="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/buttons_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_indications_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/indication_error_title"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_indications_0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="@string/open_configure"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_indications_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="@string/supported_url_indication_1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/display_indications_img_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/display_indications_1_description"
|
||||
android:paddingBottom="5dp"
|
||||
android:src="@drawable/img1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_indications_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="@string/supported_url_indication_2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_img_1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/display_indications_img_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/display_indications_1_description"
|
||||
android:paddingBottom="5dp"
|
||||
android:src="@drawable/img2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_indications_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="@string/supported_url_indication_3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_img_2" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/display_indications_img_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/display_indications_3_description"
|
||||
android:paddingBottom="5dp"
|
||||
android:src="@drawable/img3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/display_indications_3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/app_icon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:contentDescription="@string/icon_of_the_app"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/app_package"
|
||||
app:layout_constraintEnd_toStartOf="@id/delete"
|
||||
app:layout_constraintStart_toEndOf="@id/app_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_package"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/delete"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@id/app_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_name"
|
||||
app:layout_constraintWidth_default="wrap" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/remove_from_default_app"
|
||||
android:src="@drawable/ic_delete"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -8,4 +8,10 @@
|
|||
android:orderInCategory="100"
|
||||
android:title="@string/action_about"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
|
|
@ -6,4 +6,5 @@
|
|||
<color name="topBar">#212121</color>
|
||||
<color name="containerCard">#272727</color>
|
||||
<color name="textColor">#EFEFEF</color>
|
||||
<color name="red">#D50000</color>
|
||||
</resources>
|
||||
|
|
|
@ -60,5 +60,18 @@
|
|||
<string name="continue_with">Continue with…</string>
|
||||
<string name="just_once">Just once</string>
|
||||
<string name="always">Always</string>
|
||||
<string name="default_app_indication">%1$s has been set by default.\nYou can remove this behavior from the app settings.</string>
|
||||
<string name="default_app_indication">%1$s has been set as a default app.\nYou can remove this behavior from the app settings.</string>
|
||||
<string name="indication_error_title">There is something wrong with the configuration of the app. Please, follow these indications to fix that issue.</string>
|
||||
<string name="open_configure">1 - Tap on the \"CONFIGURE\" button above.</string>
|
||||
<string name="supported_url_indication_1">2 - You are now in app settings from your device. Tap on \"Set as default\".</string>
|
||||
<string name="display_indications_1_description">Screenshot showing app settings for the app. You have to Tap on \"Set as default\"</string>
|
||||
<string name="supported_url_indication_2">2 - Then tap on \"Go to supported URLs\".</string>
|
||||
<string name="display_indications_2_description">Screenshot showing app settings for the app. You have to Tap on \"Go to supported URLs\"</string>
|
||||
<string name="supported_url_indication_3">3 - In suggestions make sure to pickup \"Always ask\"</string>
|
||||
<string name="display_indications_3_description">Screenshot showing app settings to define the behavior for opening URLs</string>
|
||||
<string name="default_apps">Default apps</string>
|
||||
<string name="remove_from_default_app">Remove from default apps</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="delete_app_from_default">Delete %1$s from default apps?</string>
|
||||
</resources>
|
||||
|
|
|
@ -24,6 +24,20 @@
|
|||
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
|
||||
</style>
|
||||
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppThemeDialogDelete" parent="Theme.AppCompat.Dialog">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:windowBackground">@color/containerCard</item>
|
||||
<item name="android:colorBackground">@color/containerCard</item>
|
||||
<item name="android:textColor">@color/textColor</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="NegativeButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
|
||||
<item name="android:textColor">@color/colorAccent</item>
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue