diff --git a/resources/tintcopy-drawable.py b/resources/tintcopy-drawable.py index d579ecb..50b9e72 100755 --- a/resources/tintcopy-drawable.py +++ b/resources/tintcopy-drawable.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import os # Requires imagemagick's convert # # Tints the drawables under 'drawable' by changing their white color @@ -7,7 +8,6 @@ # to the 'drawable' folder used by the application. Run this if you add # new drawables on the folder. Icons from https://material.io/icons import re -import os import subprocess # http://www.imagemagick.org/Usage/color_mods/#diy_levels @@ -34,4 +34,3 @@ ipng = os.path.join('drawable', dpi, png) opng = os.path.join(outdir, dpi, png.replace('_white', '')) subprocess.run(command.format(ipng, color, opng), shell=True) - diff --git a/src/app/build.gradle b/src/app/build.gradle index 1af53fa..bfd8bbe 100644 --- a/src/app/build.gradle +++ b/src/app/build.gradle @@ -5,19 +5,16 @@ if (enable_plugin_kotlin) { apply plugin: 'kotlin-kapt' } -ext.version_setup_minSdk = 15 - android { - compileSdkVersion version_setup_compileSdk - flavorDimensions "default" + compileSdkVersion 28 + buildToolsVersion '28.0.3' defaultConfig { - minSdkVersion version_setup_minSdk - targetSdkVersion version_setup_targetSdk - + applicationId "io.github.lonamiwebs.stringlate" + minSdkVersion 15 + targetSdkVersion 28 versionCode 1006 versionName "0.15.1" - applicationId "io.github.lonamiwebs.stringlate" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -27,10 +24,7 @@ android { resValue "string", "manifest_package_id", "io.github.lonamiwebs.stringlate" } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } + flavorDimensions "default" buildTypes { release { @@ -45,6 +39,12 @@ android { } } + compileOptions { + encoding = 'UTF-8' + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + lintOptions { disable 'MissingTranslation' disable 'ExtraTranslation' @@ -58,14 +58,25 @@ android { } } +ext { + // https://developer.android.com/topic/libraries/support-library/revisions.html + supportLib = '28.0.0' + + // https://github.com/JakeWharton/butterknife/releases + butterknife = '8.8.1' + + // https://github.com/guardianproject/NetCipher/releases + netcipher = '2.0.0-beta1' +} + dependencies { // Android standard libs - implementation "com.android.support:appcompat-v7:${version_library_appcompat}" - implementation "com.android.support:design:${version_library_appcompat}" - implementation "com.android.support:preference-v7:${version_library_appcompat}" - implementation "com.android.support:preference-v14:${version_library_appcompat}" + implementation "com.android.support:design:${supportLib}" + implementation "com.android.support:appcompat-v7:${supportLib}" + implementation "com.android.support:preference-v7:${supportLib}" + implementation "com.android.support:preference-v14:${supportLib}" // Tool libraries - implementation "com.jakewharton:butterknife:${version_library_butterknife}" + implementation "com.jakewharton:butterknife:${butterknife}" // Include core project implementation(project(':core')) { exclude(group: 'org.json', module: 'json') @@ -73,7 +84,7 @@ dependencies { } // Processors - def anpros = ["com.jakewharton:butterknife-compiler:${version_library_butterknife}"] + def anpros = ["com.jakewharton:butterknife-compiler:${butterknife}"] for (anpro in anpros) { if (enable_plugin_kotlin) { kapt anpro diff --git a/src/app/src/main/AndroidManifest.xml b/src/app/src/main/AndroidManifest.xml index 51967e9..931eec7 100644 --- a/src/app/src/main/AndroidManifest.xml +++ b/src/app/src/main/AndroidManifest.xml @@ -17,17 +17,19 @@ android:allowBackup="true" android:fullBackupContent="true" android:icon="@drawable/ic_launcher" - android:roundIcon="@drawable/ic_launcher" android:label="@string/app_name" + android:roundIcon="@drawable/ic_launcher" android:supportsRtl="true" android:theme="@style/AppTheme"> - + + android:exported="true" + android:label="@string/app_name"> @@ -62,16 +64,14 @@ android:name="android.app.searchable" android:resource="@xml/searchable" /> - - + + + android:label="@string/settings" + android:theme="@style/AppTheme.NoActionBar"> diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/DiscoverActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/DiscoverActivity.java index 048aa48..fe2f054 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/DiscoverActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/DiscoverActivity.java @@ -2,7 +2,6 @@ import android.app.SearchManager; import android.content.Context; -import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; @@ -58,25 +57,20 @@ protected void onCreate(Bundle savedInstanceState) { mApplicationListView.setAdapter(mApplicationAdapter); mApplicationListView.setLayoutManager(new LinearLayoutManager(this)); - mApplicationAdapter.onItemClick = new ApplicationAdapter.OnItemClick() { - @Override - public void onClick(final Intent data) { - setResult(RESULT_OK, data); - finish(); - } + mApplicationAdapter.onItemClick = data -> { + setResult(RESULT_OK, data); + finish(); }; mApplicationListView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { - if (dy > 0 || dy <= 0) { - final LinearLayoutManager manager = (LinearLayoutManager) - mApplicationListView.getLayoutManager(); - - if (manager.findFirstVisibleItemPosition() + manager.getChildCount() == - manager.getItemCount()) { - mApplicationAdapter.loadMore(); - } + final LinearLayoutManager manager = (LinearLayoutManager) + mApplicationListView.getLayoutManager(); + + if (manager.findFirstVisibleItemPosition() + manager.getChildCount() == + manager.getItemCount()) { + mApplicationAdapter.loadMore(); } } }); diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/SettingsActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/SettingsActivity.java index 78bb227..a26cbd3 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/SettingsActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/SettingsActivity.java @@ -3,7 +3,6 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.graphics.Color; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; @@ -21,7 +20,6 @@ import android.widget.Toast; import net.gsantner.opoc.preference.GsPreferenceFragmentCompat; -import net.gsantner.opoc.preference.SharedPreferencesPropertyBackend; import io.github.lonamiwebs.stringlate.R; import io.github.lonamiwebs.stringlate.classes.git.GitHub; diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateGistActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateGistActivity.java index 69f382e..71e2f92 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateGistActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateGistActivity.java @@ -93,7 +93,7 @@ public void onPostGist(final View v) { mRepo.applyTemplate(defaultResources[0], mLocale)); } } - if (!new ContextUtils(this).isConnectedToInternet(R.string.no_internet_connection)) + if (new ContextUtils(this).isOffline(R.string.no_internet_connection)) return; final String description = mDescriptionEditText.getText().toString().trim(); diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateIssueActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateIssueActivity.java index 4bd8e1f..c0373b6 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateIssueActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateIssueActivity.java @@ -90,7 +90,7 @@ public void onCreateIssue(final View v) { ); description = description.replace("%x", xml); } - if (!new ContextUtils(this).isConnectedToInternet(R.string.no_internet_connection)) + if (new ContextUtils(this).isOffline(R.string.no_internet_connection)) return; CreateUrlActivity.launchIntent(this, Exporter.createIssueExporter( diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateUrlActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateUrlActivity.java index b0fb41c..c716637 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateUrlActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/export/CreateUrlActivity.java @@ -15,8 +15,6 @@ import android.widget.TextView; import android.widget.Toast; -import net.gsantner.opoc.util.Callback; - import io.github.lonamiwebs.stringlate.R; import static io.github.lonamiwebs.stringlate.utilities.Constants.EXTRA_ID; @@ -57,12 +55,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override protected String doInBackground(Void... params) { try { - return mPostUrlCallable.call(CreateUrlActivity.this, new Callback.a1() { - @Override - public void callback(String s) { - publishProgress(s); - } - }); + return mPostUrlCallable.call(CreateUrlActivity.this, this::publishProgress); } catch (Exception e) { e.printStackTrace(); return null; diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/info/MoreInfoFragment.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/info/MoreInfoFragment.java index bf25dcc..526496e 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/info/MoreInfoFragment.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/info/MoreInfoFragment.java @@ -21,17 +21,17 @@ import android.support.v7.preference.Preference; import android.support.v7.preference.PreferenceGroup; -import io.github.lonamiwebs.stringlate.R; -import io.github.lonamiwebs.stringlate.activities.SettingsActivity; -import io.github.lonamiwebs.stringlate.settings.AppSettings; import net.gsantner.opoc.format.markdown.SimpleMarkdownParser; import net.gsantner.opoc.preference.GsPreferenceFragmentCompat; import net.gsantner.opoc.util.ActivityUtils; -import net.gsantner.opoc.util.ShareUtil; import java.io.IOException; import java.util.Locale; +import io.github.lonamiwebs.stringlate.R; +import io.github.lonamiwebs.stringlate.activities.SettingsActivity; +import io.github.lonamiwebs.stringlate.settings.AppSettings; + public class MoreInfoFragment extends GsPreferenceFragmentCompat { public static final String TAG = "MoreInfoFragment"; @@ -190,7 +190,6 @@ public synchronized void doUpdatePreferences() { } appendPreference(person, (PreferenceGroup) pref); } - } } } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/AddNewRepositoryFragment.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/AddNewRepositoryFragment.java index 5adf421..560a5a8 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/AddNewRepositoryFragment.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/AddNewRepositoryFragment.java @@ -104,29 +104,24 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, } // If the user presses enter on an EditText, select the next one - mOwnerEditText.setOnKeyListener(new View.OnKeyListener() { - public boolean onKey(View v, int kc, KeyEvent e) { - if (e.getAction() == KeyEvent.ACTION_DOWN && kc == KeyEvent.KEYCODE_ENTER) { - mRepositoryEditText.requestFocus(); - return true; - } - return false; + mOwnerEditText.setOnKeyListener((v, kc, e) -> { + if (e.getAction() == KeyEvent.ACTION_DOWN && kc == KeyEvent.KEYCODE_ENTER) { + mRepositoryEditText.requestFocus(); + return true; } + return false; }); // Or, if we're on the repository EditText, hide the keyboard - mRepositoryEditText.setOnKeyListener(new View.OnKeyListener() { - @Override - public boolean onKey(View v, int kc, KeyEvent e) { - if (e.getAction() == KeyEvent.ACTION_DOWN && kc == KeyEvent.KEYCODE_ENTER) { - InputMethodManager imm = (InputMethodManager) - getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - - imm.hideSoftInputFromWindow(mRepositoryEditText.getWindowToken(), 0); - return true; - } - return false; + mRepositoryEditText.setOnKeyListener((v, kc, e) -> { + if (e.getAction() == KeyEvent.ACTION_DOWN && kc == KeyEvent.KEYCODE_ENTER) { + InputMethodManager imm = (InputMethodManager) + getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + + imm.hideSoftInputFromWindow(mRepositoryEditText.getWindowToken(), 0); + return true; } + return false; }); getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); @@ -138,7 +133,8 @@ public boolean onKey(View v, int kc, KeyEvent e) { //region UI events - @OnTextChanged(callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED, value = {R.id.github_ownerEditText, R.id.github_repositoryEditText}) + @OnTextChanged(callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED, value = + {R.id.github_ownerEditText, R.id.github_repositoryEditText}) public void onGitHubRepoEditChanged(CharSequence newText) { final String owner = mOwnerEditText.getText().toString().trim(); final String repository = mRepositoryEditText.getText().toString().trim(); @@ -149,13 +145,8 @@ public void onGitHubRepoEditChanged(CharSequence newText) { } } - private final View.OnClickListener onDiscoverClick = new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivityForResult(new Intent(getContext(), - DiscoverActivity.class), RESULT_REPO_DISCOVERED); - } - }; + private final View.OnClickListener onDiscoverClick = view -> startActivityForResult(new Intent(getContext(), + DiscoverActivity.class), RESULT_REPO_DISCOVERED); private final View.OnClickListener onNextClick = new View.OnClickListener() { @Override @@ -217,7 +208,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { //region Checking and adding a new local "repository" private void scanDownloadStrings(final RepoHandler repo) { - if (!new ContextUtils(getContext()).isConnectedToInternet(R.string.no_internet_connection)) + if (new ContextUtils(getContext()).isOffline(R.string.no_internet_connection)) return; new RepoSyncTask(getContext(), repo, diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/HistoryFragment.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/HistoryFragment.java index 393375c..3c576b9 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/HistoryFragment.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/HistoryFragment.java @@ -1,6 +1,5 @@ package io.github.lonamiwebs.stringlate.activities.repositories; -import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Build; @@ -49,7 +48,6 @@ public class HistoryFragment extends Fragment { private AppSettings mSettings; - private RecyclerView mRepositoryListView; private RepoHandlerAdapter mRepositoryAdapter; private TextView mHistoryMessageTextView; @@ -67,7 +65,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_history, container, false); - mRepositoryListView = rootView.findViewById(R.id.repositoryListView); + RecyclerView mRepositoryListView = rootView.findViewById(R.id.repositoryListView); mRepositoryAdapter = new RepoHandlerAdapter(getContext()); mRepositoryListView.setAdapter(mRepositoryAdapter); @@ -159,12 +157,7 @@ private void promptDeleteRepo(final RepoHandler repo) { new AlertDialog.Builder(getContext()) .setTitle(R.string.sure_question) .setMessage(getString(R.string.delete_repository_confirm_long, repo.toString())) - .setPositiveButton(getString(R.string.delete_repository), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - repo.delete(); - } - }) + .setPositiveButton(getString(R.string.delete_repository), (dialogInterface, i) -> repo.delete()) .setNegativeButton(getString(R.string.cancel), null) .show(); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/RepositoriesActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/RepositoriesActivity.java index 6401e7b..1e9618d 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/RepositoriesActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/RepositoriesActivity.java @@ -1,20 +1,14 @@ package io.github.lonamiwebs.stringlate.activities.repositories; import android.content.Intent; -import android.graphics.Color; -import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; -import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; -import android.view.Menu; -import android.view.MenuInflater; import android.view.MenuItem; import io.github.lonamiwebs.stringlate.R; -import io.github.lonamiwebs.stringlate.activities.info.BrowserActivity; import io.github.lonamiwebs.stringlate.activities.SettingsActivity; import io.github.lonamiwebs.stringlate.activities.translate.TranslateActivity; import io.github.lonamiwebs.stringlate.classes.repos.RepoHandler; diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/PeekTranslationsActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/PeekTranslationsActivity.java index 899fb8d..b53a57b 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/PeekTranslationsActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/PeekTranslationsActivity.java @@ -3,8 +3,6 @@ import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.AdapterView; import android.widget.ListView; import java.util.ArrayList; @@ -47,12 +45,7 @@ protected void onCreate(Bundle savedInstanceState) { setTitle(String.format("%s/%s", mRepo.getProjectName(), getString(R.string.peek_translations))); refreshTranslationsListView(); - mTranslationsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView adapterView, View view, int i, long l) { - finish(); - } - }); + mTranslationsListView.setOnItemClickListener((adapterView, view, i, l) -> finish()); } //endregion diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/SearchStringActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/SearchStringActivity.java index 2a6deda..365c9a8 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/SearchStringActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/SearchStringActivity.java @@ -6,7 +6,6 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.View; -import android.widget.AdapterView; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ListView; @@ -28,9 +27,6 @@ public class SearchStringActivity extends AppCompatActivity { //region Members - private RepoHandler mRepo; - private String mLocale; - private EditText mSearchEditText; private ListView mResourcesListView; @@ -51,8 +47,8 @@ protected void onCreate(Bundle savedInstanceState) { final ImageButton clearFilterButton = findViewById(R.id.clearFilterButton); Intent intent = getIntent(); - mRepo = RepoHandlerHelper.fromBundle(intent.getBundleExtra(EXTRA_REPO)); - mLocale = intent.getStringExtra(EXTRA_LOCALE); + RepoHandler mRepo = RepoHandlerHelper.fromBundle(intent.getBundleExtra(EXTRA_REPO)); + String mLocale = intent.getStringExtra(EXTRA_LOCALE); setTitle(String.format("%s/%s (%s)", mRepo.getProjectName(), LocaleString.getDisplay(mLocale), mLocale)); @@ -82,17 +78,14 @@ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } }); - mResourcesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView adapterView, View view, int i, long l) { - final String filter = mSearchEditText.getText().toString(); - ResourcesTranslation rt = (ResourcesTranslation) mResourcesListView.getItemAtPosition(i); - Intent data = new Intent(); - data.putExtra("id", rt.getId()); - data.putExtra("filter", filter); - setResult(RESULT_OK, data); - finish(); - } + mResourcesListView.setOnItemClickListener((adapterView, view, i, l) -> { + final String filter = mSearchEditText.getText().toString(); + ResourcesTranslation rt = (ResourcesTranslation) mResourcesListView.getItemAtPosition(i); + Intent data = new Intent(); + data.putExtra("id", rt.getId()); + data.putExtra("filter", filter); + setResult(RESULT_OK, data); + finish(); }); mSearchEditText.setText(mRepo.settings.getStringFilter()); diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/TranslateActivity.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/TranslateActivity.java index 2daf888..9ff9159 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/TranslateActivity.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/translate/TranslateActivity.java @@ -3,7 +3,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.graphics.Paint; import android.graphics.Typeface; import android.net.Uri; import android.os.Build; @@ -47,10 +46,10 @@ import java.util.Set; import io.github.lonamiwebs.stringlate.R; -import io.github.lonamiwebs.stringlate.activities.info.BrowserActivity; import io.github.lonamiwebs.stringlate.activities.export.CreateGistActivity; import io.github.lonamiwebs.stringlate.activities.export.CreateIssueActivity; import io.github.lonamiwebs.stringlate.activities.export.CreatePullRequestActivity; +import io.github.lonamiwebs.stringlate.activities.info.BrowserActivity; import io.github.lonamiwebs.stringlate.classes.RepoSyncTask; import io.github.lonamiwebs.stringlate.classes.locales.LocaleString; import io.github.lonamiwebs.stringlate.classes.repos.RepoHandler; @@ -420,12 +419,7 @@ private void askUpdateStrings() { new AlertDialog.Builder(this) .setTitle(R.string.pulling_strings) .setMessage(R.string.pulling_strings_long) - .setPositiveButton(R.string.pulling_strings, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - askBranchUpdateStrings(); - } - }) + .setPositiveButton(R.string.pulling_strings, (dialogInterface, i) -> askBranchUpdateStrings()) .setNegativeButton(R.string.cancel, null) .show(); } else { @@ -447,17 +441,8 @@ private void askBranchUpdateStrings() { if (branches.length > 1) { new AlertDialog.Builder(this) .setTitle(R.string.select_branch) - .setPositiveButton(getString(R.string.ignore), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - updateStrings("HEAD"); - } - }) - .setItems(branches, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int item) { - updateStrings(branches[item].toString()); - } - }) + .setPositiveButton(getString(R.string.ignore), (dialogInterface, i) -> updateStrings("HEAD")) + .setItems(branches, (dialog, item) -> updateStrings(branches[item].toString())) .show(); } else { updateStrings("HEAD"); @@ -466,7 +451,7 @@ public void onClick(DialogInterface dialog, int item) { // Synchronize our local strings.xml files with the remote GitHub repository private void updateStrings(@NonNull final String branch) { - if (!new ContextUtils(this).isConnectedToInternet(R.string.no_internet_connection)) + if (new ContextUtils(this).isOffline(R.string.no_internet_connection)) return; // Don't let the users stay while we're synchronizing resources. @@ -686,7 +671,7 @@ private void exportToPullRequest() { Toast.makeText(this, R.string.login_required, Toast.LENGTH_LONG).show(); return; } - if (!new ContextUtils(this).isConnectedToInternet(R.string.no_internet_connection)) + if (new ContextUtils(this).isOffline(R.string.no_internet_connection)) return; Intent intent = new Intent(this, CreatePullRequestActivity.class); @@ -767,17 +752,14 @@ private void promptDeleteLocale() { new AlertDialog.Builder(this) .setTitle(R.string.sure_question) .setMessage(getString(R.string.delete_locale_confirm_long, mSelectedLocale)) - .setPositiveButton(getString(R.string.delete_locale), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - mRepo.deleteLocale(mSelectedLocale); - loadLocalesSpinner(); - checkTranslationVisibility(); - - // We need to clear the selected locale if it's now empty - if (mLocaleSpinner.getCount() == 0) - setCurrentLocale(null); - } + .setPositiveButton(getString(R.string.delete_locale), (dialogInterface, i) -> { + mRepo.deleteLocale(mSelectedLocale); + loadLocalesSpinner(); + checkTranslationVisibility(); + + // We need to clear the selected locale if it's now empty + if (mLocaleSpinner.getCount() == 0) + setCurrentLocale(null); }) .setNegativeButton(getString(R.string.cancel), null) .show(); @@ -800,12 +782,9 @@ private void promptDeleteRepo() { new AlertDialog.Builder(this) .setTitle(R.string.sure_question) .setMessage(getString(R.string.delete_repository_confirm_long, mRepo.toString())) - .setPositiveButton(getString(R.string.delete_repository), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - mRepo.delete(); - finish(); - } + .setPositiveButton(getString(R.string.delete_repository), (dialogInterface, i) -> { + mRepo.delete(); + finish(); }) .setNegativeButton(getString(R.string.cancel), null) .show(); diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/ApplicationAdapter.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/ApplicationAdapter.java index 35110b7..582911f 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/ApplicationAdapter.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/ApplicationAdapter.java @@ -101,18 +101,15 @@ public ViewHolder onCreateViewHolder(final ViewGroup parent, final int i) { @Override public void onBindViewHolder(final ViewHolder view, final int i) { view.update(appsSlice.get(i)); - view.root.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (onItemClick != null) { - final ApplicationDetails app = appsSlice.get(view.getLayoutPosition()); - Intent data = new Intent(); - data.putExtra("url", app.getSourceCodeUrl()); - data.putExtra("web", app.getProjectWebUrl()); - data.putExtra("name", app.getProjectName()); - data.putExtra("mail", app.getProjectMail()); - onItemClick.onClick(data); - } + view.root.setOnClickListener(v -> { + if (onItemClick != null) { + final ApplicationDetails app = appsSlice.get(view.getLayoutPosition()); + Intent data = new Intent(); + data.putExtra("url", app.getSourceCodeUrl()); + data.putExtra("web", app.getProjectWebUrl()); + data.putExtra("name", app.getProjectName()); + data.putExtra("mail", app.getProjectMail()); + onItemClick.onClick(data); } }); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/LocaleEntryAdapter.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/LocaleEntryAdapter.java index 827f12c..3ca9953 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/LocaleEntryAdapter.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/LocaleEntryAdapter.java @@ -13,7 +13,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.Locale; @@ -95,7 +94,7 @@ public LocaleEntryAdapter(final Context context, final String localeCode) { mPreferredLocale = new AppSettings(context).getLanguage(); mShowMoreLocales = true; if (localeCode.isEmpty()) { - initLocales(new ArrayList(0)); + initLocales(new ArrayList<>(0)); } else { final ArrayList locales = new ArrayList<>(); for (Locale locale : Locale.getAvailableLocales()) @@ -109,28 +108,23 @@ public LocaleEntryAdapter(final Context context, final String localeCode) { public void initLocales(final Collection locales) { mLocales = new ArrayList<>(locales.size()); mFilteredLocales = new ArrayList<>(locales.size()); - for (Locale locale : locales) - mLocales.add(locale); - - Collections.sort(mLocales, new Comparator() { - @Override - public int compare(Locale o1, Locale o2) { - final boolean left = o1.getLanguage().equals(mPreferredLocale); - final boolean right = o2.getLanguage().equals(mPreferredLocale); - if (left != right) { - if (left) - return -1; - else - return +1; - } else { - return LocaleString.getFullCode(o1).compareTo(LocaleString.getFullCode(o2)); - } + mLocales.addAll(locales); + + Collections.sort(mLocales, (o1, o2) -> { + final boolean left = o1.getLanguage().equals(mPreferredLocale); + final boolean right = o2.getLanguage().equals(mPreferredLocale); + if (left != right) { + if (left) + return -1; + else + return +1; + } else { + return LocaleString.getFullCode(o1).compareTo(LocaleString.getFullCode(o2)); } }); // Initial collection is now sorted, so add everything to our filtered list - for (Locale locale : mLocales) - mFilteredLocales.add(locale); + mFilteredLocales.addAll(mLocales); notifyDataSetChanged(); } @@ -159,20 +153,14 @@ public ViewHolder onCreateViewHolder(final ViewGroup parent, final int i) { @Override public void onBindViewHolder(final ViewHolder view, final int i) { view.update(mFilteredLocales.get(i)); - ((LinearLayout) view.expand.getParent()).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (onItemClick != null) { - onItemClick.onLocaleExpanderSelected(mFilteredLocales.get(view.getAdapterPosition())); - } + ((LinearLayout) view.expand.getParent()).setOnClickListener(v -> { + if (onItemClick != null) { + onItemClick.onLocaleExpanderSelected(mFilteredLocales.get(view.getAdapterPosition())); } }); - ((LinearLayout) view.displayLang.getParent()).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (onItemClick != null) { - onItemClick.onLocaleSelected(mFilteredLocales.get(view.getAdapterPosition())); - } + ((LinearLayout) view.displayLang.getParent()).setOnClickListener(v -> { + if (onItemClick != null) { + onItemClick.onLocaleSelected(mFilteredLocales.get(view.getAdapterPosition())); } }); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/RepoHandlerAdapter.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/RepoHandlerAdapter.java index e6c8b9f..1f8d869 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/RepoHandlerAdapter.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/adapters/RepoHandlerAdapter.java @@ -1,7 +1,6 @@ package io.github.lonamiwebs.stringlate.adapters; import android.content.Context; -import android.content.DialogInterface; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; @@ -146,21 +145,13 @@ public void onBindViewHolder(final ViewHolder view, int i) { view.updateProgress(progress == null ? null : progress.getProgress()); view.showMenu = true; - view.root.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - TranslateActivity.launch(mContext, mRepositories.get( - view.getAdapterPosition()) - ); - } - }); + view.root.setOnClickListener(v -> TranslateActivity.launch(mContext, mRepositories.get( + view.getAdapterPosition()) + )); - view.root.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - mContextMenuRepo = mRepositories.get(view.getAdapterPosition()); - return false; - } + view.root.setOnLongClickListener(v -> { + mContextMenuRepo = mRepositories.get(view.getAdapterPosition()); + return false; }); } else if (i == mRepositories.size()) { // Separator view on the edge case @@ -170,20 +161,12 @@ public boolean onLongClick(View v) { final Pair repo = mSyncingRepositories.get(i); view.update(repo.first, mSize); view.updateProgress(repo.second); - view.root.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - AlertDialog.Builder dialog = new AlertDialog.Builder(mContext) - .setPositiveButton(android.R.string.cancel, null) - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - repo.first.cancel(); - } - }) - .setTitle(R.string.cancel_sync); - dialog.show(); - } + view.root.setOnClickListener(view1 -> { + AlertDialog.Builder dialog = new AlertDialog.Builder(mContext) + .setPositiveButton(android.R.string.cancel, null) + .setPositiveButton(android.R.string.ok, (dialogInterface, i1) -> repo.first.cancel()) + .setTitle(R.string.cancel_sync); + dialog.show(); }); view.showMenu = false; } @@ -213,8 +196,7 @@ public RepoHandler getContextMenuRepository() { // Returns true if there are items left, or false otherwise public boolean notifyDataSetChanged(final ArrayList repositories) { mRepositories.clear(); - for (RepoHandler repo : repositories) - mRepositories.add(repo); + mRepositories.addAll(repositories); Collections.sort(mRepositories); notifyDataSetChanged(); diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/RepoSyncTask.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/RepoSyncTask.java index f832c27..da85fed 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/RepoSyncTask.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/RepoSyncTask.java @@ -31,37 +31,26 @@ public RepoSyncTask(final Context context, final RepoHandler repo, @Override public void run() { final boolean okay = - RepoHandlerHelper.syncResources(mContext, mRepo, mSource, new Messenger.OnSyncProgress() { - @Override - public void onUpdate(final int stage, final float progress) { - mHandler.post(new Runnable() { - @Override - public void run() { - onProgressUpdate(stage, progress); - } - }); - } - }); + RepoHandlerHelper.syncResources(mContext, mRepo, mSource, (stage, progress) -> + mHandler.post(() -> + onProgressUpdate(stage, progress))); - mHandler.post(new Runnable() { - @Override - public void run() { - Messenger.notifyRepoSyncFinished(mRepo, okay); - if (okay) { - Messenger.notifyRepoAdded(mRepo); - } else { - if (!mRepo.wasCancelled()) { - Toast.makeText( - mContext, - mContext.getString(R.string.sync_failed, mRepo.getProjectName()), - Toast.LENGTH_SHORT - ).show(); - } - - // New repository, so it cannot have old resources- delete it since it failed - if (newRepo) - mRepo.delete(); + mHandler.post(() -> { + Messenger.notifyRepoSyncFinished(mRepo, okay); + if (okay) { + Messenger.notifyRepoAdded(mRepo); + } else { + if (!mRepo.wasCancelled()) { + Toast.makeText( + mContext, + mContext.getString(R.string.sync_failed, mRepo.getProjectName()), + Toast.LENGTH_SHORT + ).show(); } + + // New repository, so it cannot have old resources- delete it since it failed + if (newRepo) + mRepo.delete(); } }); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationList.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationList.java index 46e4174..1cbbb29 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationList.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationList.java @@ -5,7 +5,6 @@ import android.content.pm.PackageManager; import android.support.annotation.NonNull; -import net.gsantner.opoc.util.Callback; import net.gsantner.opoc.util.NetworkUtils; import net.gsantner.opoc.util.ZipUtils; @@ -17,7 +16,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; -import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -31,7 +29,6 @@ public class ApplicationList implements Iterable { //region Members private final File mRoot; - private final Context mContext; private static final String BASE_DIR = "index"; @@ -50,19 +47,18 @@ public class ApplicationList implements Iterable { public ApplicationList(Context context) { mApplications = new ArrayList<>(); - mContext = context; mSliceFilter = ""; - mRoot = new File(mContext.getCacheDir(), BASE_DIR); + mRoot = new File(context.getCacheDir(), BASE_DIR); mInstalledPackages = new HashSet<>(); - PackageManager pm = mContext.getPackageManager(); + PackageManager pm = context.getPackageManager(); List packages = pm.getInstalledApplications(PackageManager.GET_META_DATA); for (ApplicationInfo packageInfo : packages) { mInstalledPackages.add(packageInfo.packageName); } - ApplicationListParser.loadFDroidIconPath(mContext); + ApplicationListParser.loadFDroidIconPath(context); } //endregion @@ -115,21 +111,13 @@ public boolean increaseSlice(int count) { public boolean syncRepo(final Messenger.OnSyncProgress callback) { // Step 1: Download the index.jar callback.onUpdate(1, 0f); - NetworkUtils.downloadFile(FDROID_INDEX_URL, getIndexFile("jar"), new Callback.a1() { - @Override - public void callback(Float progress) { - callback.onUpdate(1, progress); - } - }); + NetworkUtils.downloadFile(FDROID_INDEX_URL, getIndexFile("jar"), progress -> + callback.onUpdate(1, progress)); // Step 2: Extract the index.xml from the index.jar, then delete the index.jar callback.onUpdate(2, 0f); - ZipUtils.unzip(getIndexFile("jar"), mRoot, true, new Callback.a1() { - @Override - public void callback(Float progress) { - callback.onUpdate(2, progress); - } - }); + ZipUtils.unzip(getIndexFile("jar"), mRoot, true, progress -> + callback.onUpdate(2, progress)); if (!getIndexFile("jar").delete()) return false; @@ -162,14 +150,11 @@ public boolean loadIndexXml() { mInstalledPackages); // Also sort the applications alphabetically, installed first - Collections.sort(mApplications, new Comparator() { - @Override - public int compare(ApplicationDetails t1, ApplicationDetails t2) { - if (t1.isInstalled() == t2.isInstalled()) { - return t1.getProjectName().compareToIgnoreCase(t2.getProjectName()); - } else { - return t1.isInstalled() ? -1 : 1; - } + Collections.sort(mApplications, (t1, t2) -> { + if (t1.isInstalled() == t2.isInstalled()) { + return t1.getProjectName().compareToIgnoreCase(t2.getProjectName()); + } else { + return t1.isInstalled() ? -1 : 1; } }); return true; diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationListParser.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationListParser.java index 953b502..54e4757 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationListParser.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationListParser.java @@ -197,7 +197,7 @@ private static void writeTag(XmlSerializer serializer, String tag, String conten serializer.startTag(ns, tag); try { serializer.text(content); - } catch (IllegalArgumentException exception){ + } catch (IllegalArgumentException exception) { // XML Parser internal broken on pre LL serializer.text(""); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationsSyncTask.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationsSyncTask.java index 81a3cab..1cb3e59 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationsSyncTask.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/applications/ApplicationsSyncTask.java @@ -36,24 +36,13 @@ private ApplicationsSyncTask(final ApplicationList appList) { @Override public void run() { - final boolean okay = mApplicationList.syncRepo(new Messenger.OnSyncProgress() { - @Override - public void onUpdate(final int stage, final float progress) { - mHandler.post(new Runnable() { - @Override - public void run() { - onProgressUpdate(stage, progress); - } - }); - } - }); + final boolean okay = mApplicationList.syncRepo((stage, progress) -> + mHandler.post(() -> + onProgressUpdate(stage, progress))); - mHandler.post(new Runnable() { - @Override - public void run() { - syncingLock.unlock(); - Messenger.notifyApplicationSyncFinished(okay); - } + mHandler.post(() -> { + syncingLock.unlock(); + Messenger.notifyApplicationSyncFinished(okay); }); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/ImageLoader.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/ImageLoader.java index 85f831a..18e0fc9 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/ImageLoader.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/ImageLoader.java @@ -56,7 +56,7 @@ public ImageLoader(Context context, boolean allowInternetDownload) { mMemoryCache = new MemoryCache(); mFileCache = new FileCache(context, "icons"); - mImageViews = Collections.synchronizedMap(new WeakHashMap()); + mImageViews = Collections.synchronizedMap(new WeakHashMap<>()); mExecutorService = Executors.newFixedThreadPool(MAX_THREADS); mHandler = new Handler(); @@ -190,15 +190,12 @@ public void run() { if (isImageViewReused(mImageToLoad)) return; - mHandler.post(new Runnable() { - @Override - public void run() { - if (!isImageViewReused(mImageToLoad)) { - if (bmp != null) - mImageToLoad.first.setImageBitmap(bmp); - else - mImageToLoad.first.setImageResource(STUB_ID); - } + mHandler.post(() -> { + if (!isImageViewReused(mImageToLoad)) { + if (bmp != null) + mImageToLoad.first.setImageBitmap(bmp); + else + mImageToLoad.first.setImageResource(STUB_ID); } }); } catch (Exception e) { diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/MemoryCache.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/MemoryCache.java index 7ba067b..b875aa5 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/MemoryCache.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/classes/lazyloader/MemoryCache.java @@ -35,7 +35,7 @@ public MemoryCache() { setLimit((long) (Runtime.getRuntime().maxMemory() * MAXIMUM_MEMORY_PERCENTAGE)); // Last argument true for Least Recently Used ordering - mCache = Collections.synchronizedMap(new LinkedHashMap( + mCache = Collections.synchronizedMap(new LinkedHashMap<>( INITIAL_CAPACITY, LOAD_FACTOR, true)); } diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/dialogs/LocaleSelectionDialog.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/dialogs/LocaleSelectionDialog.java index b0f841f..0e39f7c 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/dialogs/LocaleSelectionDialog.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/dialogs/LocaleSelectionDialog.java @@ -1,6 +1,5 @@ package io.github.lonamiwebs.stringlate.dialogs; - import android.app.Activity; import android.app.Dialog; import android.app.DialogFragment; @@ -17,7 +16,6 @@ import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; -import android.widget.CompoundButton; import android.widget.EditText; import java.util.ArrayList; @@ -78,12 +76,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, } } - mMoreSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean b) { - setupAdapter(); - } - }); + mMoreSwitch.setOnCheckedChangeListener((compoundButton, b) -> setupAdapter()); mSearchEditText.addTextChangedListener(new TextWatcher() { @Override @@ -100,12 +93,7 @@ public void afterTextChanged(Editable s) { } }); - root.findViewById(R.id.cancel_button).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - dismiss(); - } - }); + root.findViewById(R.id.cancel_button).setOnClickListener(v -> dismiss()); return root; } @@ -131,7 +119,8 @@ public void onLocaleExpanderSelected(Locale which) { } public void setupAdapter() { - mLocaleEntryAdapterLocales = new LocaleEntryAdapter(getActivity(), false, mMoreSwitch.isChecked()); + mLocaleEntryAdapterLocales = new LocaleEntryAdapter(getActivity(), + false, mMoreSwitch.isChecked()); mLocaleEntryAdapterLocales.onItemClick = new LocaleEntryAdapter.OnItemClick() { @Override public void onLocaleSelected(final Locale which) { diff --git a/src/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/ContextUtils.java b/src/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/ContextUtils.java index fc8a4f0..9dce576 100644 --- a/src/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/ContextUtils.java +++ b/src/app/src/main/java/io/github/lonamiwebs/stringlate/utilities/ContextUtils.java @@ -20,11 +20,11 @@ public ContextUtils(Context context) { super(context); } - public boolean isConnectedToInternet(@Nullable @StringRes Integer warnMessageStringRes) { + public boolean isOffline(@Nullable @StringRes Integer warnMessageStringRes) { final boolean result = isConnectedToInternet(); if (!result && warnMessageStringRes != null) Toast.makeText(_context, _context.getString(warnMessageStringRes), Toast.LENGTH_SHORT).show(); - return result; + return !result; } } diff --git a/src/app/src/main/res/drawable-anydpi-v26/ic_launcher.xml b/src/app/src/main/res/drawable-anydpi-v26/ic_launcher.xml index 9a172ad..a706dec 100644 --- a/src/app/src/main/res/drawable-anydpi-v26/ic_launcher.xml +++ b/src/app/src/main/res/drawable-anydpi-v26/ic_launcher.xml @@ -1,9 +1,11 @@ - - + + - + \ No newline at end of file diff --git a/src/app/src/main/res/drawable/drawable_progress_bar.xml b/src/app/src/main/res/drawable/drawable_progress_bar.xml index 384568b..92f6410 100644 --- a/src/app/src/main/res/drawable/drawable_progress_bar.xml +++ b/src/app/src/main/res/drawable/drawable_progress_bar.xml @@ -1,5 +1,4 @@ - - + diff --git a/src/app/src/main/res/drawable/ic_add_box_white_24dp.xml b/src/app/src/main/res/drawable/ic_add_box_white_24dp.xml index d55fc42..e40f44a 100644 --- a/src/app/src/main/res/drawable/ic_add_box_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_add_box_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml b/src/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml index 04a5dde..5a52737 100644 --- a/src/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml @@ -1,4 +1,9 @@ - - + + diff --git a/src/app/src/main/res/drawable/ic_backspace_yellow_36dp.xml b/src/app/src/main/res/drawable/ic_backspace_yellow_36dp.xml index f1edf79..b97b882 100644 --- a/src/app/src/main/res/drawable/ic_backspace_yellow_36dp.xml +++ b/src/app/src/main/res/drawable/ic_backspace_yellow_36dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_bug_report_black_24dp.xml b/src/app/src/main/res/drawable/ic_bug_report_black_24dp.xml index 4d83902..206702f 100644 --- a/src/app/src/main/res/drawable/ic_bug_report_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_bug_report_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z" /> diff --git a/src/app/src/main/res/drawable/ic_check_black_12dp.xml b/src/app/src/main/res/drawable/ic_check_black_12dp.xml index 3468093..6155466 100644 --- a/src/app/src/main/res/drawable/ic_check_black_12dp.xml +++ b/src/app/src/main/res/drawable/ic_check_black_12dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_check_black_24dp.xml b/src/app/src/main/res/drawable/ic_check_black_24dp.xml index 3c728c5..620bc91 100644 --- a/src/app/src/main/res/drawable/ic_check_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_check_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" /> diff --git a/src/app/src/main/res/drawable/ic_code_black_24dp.xml b/src/app/src/main/res/drawable/ic_code_black_24dp.xml index 6f1ccb6..56e53d0 100644 --- a/src/app/src/main/res/drawable/ic_code_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_code_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z" /> diff --git a/src/app/src/main/res/drawable/ic_copyright_black_24dp.xml b/src/app/src/main/res/drawable/ic_copyright_black_24dp.xml index fad6892..6e9296d 100644 --- a/src/app/src/main/res/drawable/ic_copyright_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_copyright_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M10.08,10.86c0.05,-0.33 0.16,-0.62 0.3,-0.87s0.34,-0.46 0.59,-0.62c0.24,-0.15 0.54,-0.22 0.91,-0.23 0.23,0.01 0.44,0.05 0.63,0.13 0.2,0.09 0.38,0.21 0.52,0.36s0.25,0.33 0.34,0.53 0.13,0.42 0.14,0.64h1.79c-0.02,-0.47 -0.11,-0.9 -0.28,-1.29s-0.4,-0.73 -0.7,-1.01 -0.66,-0.5 -1.08,-0.66 -0.88,-0.23 -1.39,-0.23c-0.65,0 -1.22,0.11 -1.7,0.34s-0.88,0.53 -1.2,0.92 -0.56,0.84 -0.71,1.36S8,11.29 8,11.87v0.27c0,0.58 0.08,1.12 0.23,1.64s0.39,0.97 0.71,1.35 0.72,0.69 1.2,0.91 1.05,0.34 1.7,0.34c0.47,0 0.91,-0.08 1.32,-0.23s0.77,-0.36 1.08,-0.63 0.56,-0.58 0.74,-0.94 0.29,-0.74 0.3,-1.15h-1.79c-0.01,0.21 -0.06,0.4 -0.15,0.58s-0.21,0.33 -0.36,0.46 -0.32,0.23 -0.52,0.3c-0.19,0.07 -0.39,0.09 -0.6,0.1 -0.36,-0.01 -0.66,-0.08 -0.89,-0.23 -0.25,-0.16 -0.45,-0.37 -0.59,-0.62s-0.25,-0.55 -0.3,-0.88 -0.08,-0.67 -0.08,-1v-0.27c0,-0.35 0.03,-0.68 0.08,-1.01zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" /> diff --git a/src/app/src/main/res/drawable/ic_delete_black_24dp.xml b/src/app/src/main/res/drawable/ic_delete_black_24dp.xml index 10ea0d3..962e033 100644 --- a/src/app/src/main/res/drawable/ic_delete_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_delete_black_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_expand_more_gray_24dp.xml b/src/app/src/main/res/drawable/ic_expand_more_gray_24dp.xml index 0db273f..2cc0a16 100644 --- a/src/app/src/main/res/drawable/ic_expand_more_gray_24dp.xml +++ b/src/app/src/main/res/drawable/ic_expand_more_gray_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z" /> diff --git a/src/app/src/main/res/drawable/ic_explore_yellow_24dp.xml b/src/app/src/main/res/drawable/ic_explore_yellow_24dp.xml index d777e0d..a332ae9 100644 --- a/src/app/src/main/res/drawable/ic_explore_yellow_24dp.xml +++ b/src/app/src/main/res/drawable/ic_explore_yellow_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_eye_white_24px.xml b/src/app/src/main/res/drawable/ic_eye_white_24px.xml index 8136c03..88e86bc 100644 --- a/src/app/src/main/res/drawable/ic_eye_white_24px.xml +++ b/src/app/src/main/res/drawable/ic_eye_white_24px.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:fillColor="#FFFFFF" + android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z" /> diff --git a/src/app/src/main/res/drawable/ic_favorite_black_24dp.xml b/src/app/src/main/res/drawable/ic_favorite_black_24dp.xml index cfba5d8..17cea92 100644 --- a/src/app/src/main/res/drawable/ic_favorite_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_favorite_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z" /> diff --git a/src/app/src/main/res/drawable/ic_format_shapes_black_24dp.xml b/src/app/src/main/res/drawable/ic_format_shapes_black_24dp.xml index 4313118..d7da043 100644 --- a/src/app/src/main/res/drawable/ic_format_shapes_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_format_shapes_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M23,7L23,1h-6v2L7,3L7,1L1,1v6h2v10L1,17v6h6v-2h10v2h6v-6h-2L21,7h2zM3,3h2v2L3,5L3,3zM5,21L3,21v-2h2v2zM17,19L7,19v-2L5,17L5,7h2L7,5h10v2h2v10h-2v2zM21,21h-2v-2h2v2zM19,5L19,3h2v2h-2zM13.73,14h-3.49l-0.73,2L7.89,16l3.4,-9h1.4l3.41,9h-1.63l-0.74,-2zM10.69,12.74h2.61L12,8.91l-1.31,3.83z" /> diff --git a/src/app/src/main/res/drawable/ic_github_black_24dp.xml b/src/app/src/main/res/drawable/ic_github_black_24dp.xml index e27a8bd..d81aab3 100644 --- a/src/app/src/main/res/drawable/ic_github_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_github_black_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="1792.0" + android:viewportHeight="1792.0"> diff --git a/src/app/src/main/res/drawable/ic_group_black_24dp.xml b/src/app/src/main/res/drawable/ic_group_black_24dp.xml index 4cfd869..603c006 100644 --- a/src/app/src/main/res/drawable/ic_group_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_group_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z" /> diff --git a/src/app/src/main/res/drawable/ic_help_white_24dp.xml b/src/app/src/main/res/drawable/ic_help_white_24dp.xml index 26e7d0d..04c1c00 100644 --- a/src/app/src/main/res/drawable/ic_help_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_help_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_history_white_24dp.xml b/src/app/src/main/res/drawable/ic_history_white_24dp.xml index 4e76e28..bb75fb8 100644 --- a/src/app/src/main/res/drawable/ic_history_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_history_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_info_black_24dp.xml b/src/app/src/main/res/drawable/ic_info_black_24dp.xml index cc94088..0cbb996 100644 --- a/src/app/src/main/res/drawable/ic_info_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_info_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + 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" /> diff --git a/src/app/src/main/res/drawable/ic_language_black_24dp.xml b/src/app/src/main/res/drawable/ic_language_black_24dp.xml index d07324c..340a4bf 100644 --- a/src/app/src/main/res/drawable/ic_language_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_language_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z" /> diff --git a/src/app/src/main/res/drawable/ic_launcher.xml b/src/app/src/main/res/drawable/ic_launcher.xml index 9a172ad..a706dec 100644 --- a/src/app/src/main/res/drawable/ic_launcher.xml +++ b/src/app/src/main/res/drawable/ic_launcher.xml @@ -1,9 +1,11 @@ - - + + - + \ No newline at end of file diff --git a/src/app/src/main/res/drawable/ic_launcher_background.xml b/src/app/src/main/res/drawable/ic_launcher_background.xml index 5846a3d..8562735 100644 --- a/src/app/src/main/res/drawable/ic_launcher_background.xml +++ b/src/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,5 +1,8 @@ - - - + + + \ No newline at end of file diff --git a/src/app/src/main/res/drawable/ic_launcher_foreground.xml b/src/app/src/main/res/drawable/ic_launcher_foreground.xml index 273da74..c83df0f 100644 --- a/src/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/src/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -1,16 +1,14 @@ - - + android:height="108dp" + android:viewportWidth="1000" + android:viewportHeight="1000"> + + + android:fillColor="#00796b" + android:pathData="M 634.64258,158.92773 448.50781,268.65039 595.53516,502.49414 162.63477,617.15234 379.75,834.26758 365.16992,841.1543 523.19531,999.17969 c 46.28295,51.05551 88.01217,96.73041 122.51441,131.06401 106.07788,105.5595 368.89008,159.1566 492.44808,90.7466 179.1383,-99.1828 189.3827,-382.18472 38.2428,-528.86747 -56.7085,-55.0362 -112.9216,-110.34915 -177.5588,-168.99392 z" /> @@ -37,9 +35,9 @@ android:translateX="-93.74456" android:translateY="1277.191"> @@ -56,9 +54,9 @@ android:translateX="814.8108" android:translateY="1190.906"> @@ -69,9 +67,9 @@ android:translateX="822.892" android:translateY="1219.695"> diff --git a/src/app/src/main/res/drawable/ic_note_add_black_24dp.xml b/src/app/src/main/res/drawable/ic_note_add_black_24dp.xml index 11d6346..b7036c0 100644 --- a/src/app/src/main/res/drawable/ic_note_add_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_note_add_black_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_open_in_browser_white_24dp.xml b/src/app/src/main/res/drawable/ic_open_in_browser_white_24dp.xml index 7671bbb..7a90c80 100644 --- a/src/app/src/main/res/drawable/ic_open_in_browser_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_open_in_browser_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_person_black_24dp.xml b/src/app/src/main/res/drawable/ic_person_black_24dp.xml index b2cb337..55495d5 100644 --- a/src/app/src/main/res/drawable/ic_person_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_person_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + 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" /> diff --git a/src/app/src/main/res/drawable/ic_play_circle_filled_yellow_24dp.xml b/src/app/src/main/res/drawable/ic_play_circle_filled_yellow_24dp.xml index b792514..4d8e8b4 100644 --- a/src/app/src/main/res/drawable/ic_play_circle_filled_yellow_24dp.xml +++ b/src/app/src/main/res/drawable/ic_play_circle_filled_yellow_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_playlist_play_black_24dp.xml b/src/app/src/main/res/drawable/ic_playlist_play_black_24dp.xml index f20557c..c0078ef 100644 --- a/src/app/src/main/res/drawable/ic_playlist_play_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_playlist_play_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M19,9L2,9v2h17L19,9zM19,5L2,5v2h17L19,5zM2,15h13v-2L2,13v2zM17,13v6l5,-3 -5,-3z" /> diff --git a/src/app/src/main/res/drawable/ic_priority_high_black_24dp.xml b/src/app/src/main/res/drawable/ic_priority_high_black_24dp.xml index 66799d8..0eda3d1 100644 --- a/src/app/src/main/res/drawable/ic_priority_high_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_priority_high_black_24dp.xml @@ -1,12 +1,12 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M12,19m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0" /> + android:pathData="M10,3h4v12h-4z" /> diff --git a/src/app/src/main/res/drawable/ic_public_black_24dp.xml b/src/app/src/main/res/drawable/ic_public_black_24dp.xml index 6348986..1928845 100644 --- a/src/app/src/main/res/drawable/ic_public_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_public_black_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_search_white_24dp.xml b/src/app/src/main/res/drawable/ic_search_white_24dp.xml index 77e582c..55da240 100644 --- a/src/app/src/main/res/drawable/ic_search_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_search_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_search_yellow_36dp.xml b/src/app/src/main/res/drawable/ic_search_yellow_36dp.xml index 54c1f47..f05b51e 100644 --- a/src/app/src/main/res/drawable/ic_search_yellow_36dp.xml +++ b/src/app/src/main/res/drawable/ic_search_yellow_36dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_settings_black_24dp.xml b/src/app/src/main/res/drawable/ic_settings_black_24dp.xml index ace746c..7c0394b 100644 --- a/src/app/src/main/res/drawable/ic_settings_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_settings_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z" /> diff --git a/src/app/src/main/res/drawable/ic_settings_white_24dp.xml b/src/app/src/main/res/drawable/ic_settings_white_24dp.xml index ce997a7..6055510 100644 --- a/src/app/src/main/res/drawable/ic_settings_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_settings_white_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z" /> diff --git a/src/app/src/main/res/drawable/ic_share_white_24dp.xml b/src/app/src/main/res/drawable/ic_share_white_24dp.xml index c5027c6..b09d63e 100644 --- a/src/app/src/main/res/drawable/ic_share_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_share_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_sort_black_24dp.xml b/src/app/src/main/res/drawable/ic_sort_black_24dp.xml index cd84e9a..b537e98 100644 --- a/src/app/src/main/res/drawable/ic_sort_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_sort_black_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_sync_black_24dp.xml b/src/app/src/main/res/drawable/ic_sync_black_24dp.xml index 2a7c466..8991613 100644 --- a/src/app/src/main/res/drawable/ic_sync_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_sync_black_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_sync_white_24dp.xml b/src/app/src/main/res/drawable/ic_sync_white_24dp.xml index e33add5..ab68c76 100644 --- a/src/app/src/main/res/drawable/ic_sync_white_24dp.xml +++ b/src/app/src/main/res/drawable/ic_sync_white_24dp.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/src/app/src/main/res/drawable/ic_thumb_up_black_24dp.xml b/src/app/src/main/res/drawable/ic_thumb_up_black_24dp.xml index 34fb51a..58dbfaf 100644 --- a/src/app/src/main/res/drawable/ic_thumb_up_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_thumb_up_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-1.91l-0.01,-0.01L23,10z" /> diff --git a/src/app/src/main/res/drawable/ic_translate_black_24dp.xml b/src/app/src/main/res/drawable/ic_translate_black_24dp.xml index 1084151..e540b32 100644 --- a/src/app/src/main/res/drawable/ic_translate_black_24dp.xml +++ b/src/app/src/main/res/drawable/ic_translate_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z" /> diff --git a/src/app/src/main/res/layout/activity_create_gist.xml b/src/app/src/main/res/layout/activity_create_gist.xml index 8b480cc..2f04d19 100644 --- a/src/app/src/main/res/layout/activity_create_gist.xml +++ b/src/app/src/main/res/layout/activity_create_gist.xml @@ -5,10 +5,10 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" - android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingBottom="@dimen/activity_vertical_margin" tools:context="io.github.lonamiwebs.stringlate.activities.export.CreateGistActivity"> @@ -45,10 +45,10 @@ android:id="@+id/noRepositoryTextView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" android:paddingRight="@dimen/activity_horizontal_margin" - android:paddingTop="@dimen/activity_vertical_margin" /> + android:paddingBottom="@dimen/activity_vertical_margin" /> + app:menu="@menu/nav_resources" + tools:elevation="2dp" /> diff --git a/src/app/src/main/res/layout/activity_search_string.xml b/src/app/src/main/res/layout/activity_search_string.xml index f33d8e9..61cd47f 100644 --- a/src/app/src/main/res/layout/activity_search_string.xml +++ b/src/app/src/main/res/layout/activity_search_string.xml @@ -11,10 +11,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" android:paddingRight="@dimen/activity_horizontal_margin" - android:paddingTop="@dimen/activity_vertical_margin"> + android:paddingBottom="@dimen/activity_vertical_margin"> - @@ -130,8 +129,8 @@ android:layout_height="wrap_content" android:layout_marginBottom="0dp" android:includeFontPadding="false" - android:paddingBottom="0dp" android:paddingTop="8dp" + android:paddingBottom="0dp" android:text="@string/translated_string_colon" android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textStyle="bold" /> diff --git a/src/app/src/main/res/layout/dialog_locale_selection.xml b/src/app/src/main/res/layout/dialog_locale_selection.xml index 3fbfa2d..349678c 100644 --- a/src/app/src/main/res/layout/dialog_locale_selection.xml +++ b/src/app/src/main/res/layout/dialog_locale_selection.xml @@ -13,14 +13,14 @@ android:id="@+id/search_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginTop="8dp" + android:layout_marginEnd="@dimen/activity_horizontal_margin" + android:layout_marginBottom="8dp" android:hint="@string/search" android:maxLines="1" - android:paddingBottom="12dp" android:paddingTop="12dp" + android:paddingBottom="12dp" android:textSize="14sp" /> + android:imeOptions="actionDone" + android:inputType="textUri" /> + android:imeOptions="actionDone" + android:maxLines="1" /> @@ -104,8 +104,8 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" - android:drawableLeft="@drawable/ic_explore_yellow_24dp" android:drawableStart="@drawable/ic_explore_yellow_24dp" + android:drawableLeft="@drawable/ic_explore_yellow_24dp" android:text="@string/discover" />