Disabled check update

Replace more alert dialog with material one
Fix tint color
This commit is contained in:
NekoInverter committed 2020-03-24 08:57:06 +08:00
1 parent fb47d4ec04
commit 6bae973ecd
16 files changed
+53 -69

No files matched your search

+3 -1
View File
@@ -15,6 +15,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.hippo.ehviewer">
<uses-permission android:name="android.permission.INTERNET" />
@@ -36,7 +37,8 @@
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="UnusedAttribute">
<uses-library
android:name="org.apache.http.legacy"
@@ -23,11 +23,10 @@ import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.hippo.ehviewer.R;
public class CheckBoxDialogBuilder extends AlertDialog.Builder {
public class CheckBoxDialogBuilder extends MaterialAlertDialogBuilder {
private final CheckBox mCheckBox;
@@ -36,9 +35,8 @@ public class CheckBoxDialogBuilder extends AlertDialog.Builder {
super(context);
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_checkbox_builder, null);
setView(view);
TextView messageView = (TextView) view.findViewById(R.id.message);
setMessage(message);
mCheckBox = (CheckBox) view.findViewById(R.id.checkbox);
messageView.setText(message);
mCheckBox.setText(checkText);
mCheckBox.setChecked(checked);
}
@@ -28,10 +28,11 @@ import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.textfield.TextInputLayout;
import com.hippo.ehviewer.R;
public class EditTextDialogBuilder extends AlertDialog.Builder implements EditText.OnEditorActionListener {
public class EditTextDialogBuilder extends MaterialAlertDialogBuilder implements EditText.OnEditorActionListener {
private final TextInputLayout mTextInputLayout;
private final EditText mEditText;
@@ -27,10 +27,11 @@ import android.widget.ListView;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.ViewUtils;
public class ListCheckBoxDialogBuilder extends AlertDialog.Builder {
public class ListCheckBoxDialogBuilder extends MaterialAlertDialogBuilder {
private final CheckBox mCheckBox;
@@ -45,14 +46,11 @@ public class ListCheckBoxDialogBuilder extends AlertDialog.Builder {
ListView listView = (ListView) ViewUtils.$$(view, R.id.list_view);
mCheckBox = (CheckBox) ViewUtils.$$(view, R.id.checkbox);
listView.setAdapter(new ArrayAdapter<>(getContext(), R.layout.item_select_dialog, items));
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (listener != null) {
listener.onItemClick(ListCheckBoxDialogBuilder.this, mDialog, position);
}
mDialog.dismiss();
listView.setOnItemClickListener((parent, view1, position, id) -> {
if (listener != null) {
listener.onItemClick(ListCheckBoxDialogBuilder.this, mDialog, position);
}
mDialog.dismiss();
});
mCheckBox.setText(checkText);
mCheckBox.setChecked(checked);
@@ -68,10 +68,10 @@ public final class CommonOperations {
private static boolean UPDATING;
public static void checkUpdate(Activity activity, boolean feedback) {
if (!UPDATING) {
/*if (!UPDATING) {
UPDATING = true;
new UpdateTask(activity, feedback).executeOnExecutor(IoThreadPoolExecutor.getInstance());
}
}*/
}
private static void doAddToFavorites(Activity activity, GalleryInfo galleryInfo,
@@ -121,17 +121,7 @@ public final class SystemUiHelper {
mHideRunnable = new HideRunnable();
// Create impl
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mImpl = new SystemUiHelperImplKK(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mImpl = new SystemUiHelperImplJB(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
mImpl = new SystemUiHelperImplICS(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mImpl = new SystemUiHelperImplHC(activity, level, flags, listener);
} else {
mImpl = new SystemUiHelperImplBase(activity, level, flags, listener);
}
mImpl = new SystemUiHelperImplKK(activity, level, flags, listener);
}
/**
@@ -19,29 +19,11 @@
android:layout_height="match_parent"
android:orientation="vertical">
<com.hippo.widget.IndicatingScrollView
style="@style/Indicating"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:id="@+id/message"
style="@style/TextAppearance.AppCompat.Subhead"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="?attr/dialogPreferredPadding"
android:paddingTop="@dimen/abc_dialog_padding_top_material"
android:paddingRight="?attr/dialogPreferredPadding" />
</com.hippo.widget.IndicatingScrollView>
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="?attr/dialogPreferredPadding"
android:layout_marginTop="@dimen/abc_dialog_padding_top_material"
android:layout_marginRight="?attr/dialogPreferredPadding" />
</LinearLayout>
@@ -19,7 +19,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@drawable/spacer_keyline"
@@ -123,8 +123,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
app:cardBackgroundColor="?attr/galleryDetailButtonBackgroundColor">
android:layout_marginRight="@dimen/keyline_margin">
<LinearLayout
android:layout_width="match_parent"
+10 -5
View File
@@ -63,7 +63,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_check_all_dark_x24" />
app:srcCompat="@drawable/v_check_all_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -71,7 +72,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_play_dark_x24" />
app:srcCompat="@drawable/v_play_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -79,7 +81,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_pause_dark_x24" />
app:srcCompat="@drawable/v_pause_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -87,7 +90,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_delete_dark_x24" />
app:srcCompat="@drawable/v_delete_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -95,7 +99,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_folder_move_dark_x24" />
app:srcCompat="@drawable/v_folder_move_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
+11 -6
View File
@@ -34,7 +34,7 @@
android:layout_marginTop="@dimen/gallery_search_bar_margin_v"
android:layout_marginRight="@dimen/gallery_search_bar_margin_h" />
<com.hippo.widget.FabLayout xmlns:app="http://schemas.android.com/apk/res-auto"
<com.hippo.widget.FabLayout
android:id="@+id/fab_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -47,7 +47,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_go_to_dark_x24" />
app:srcCompat="@drawable/v_go_to_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -55,7 +56,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_refresh_dark_x24" />
app:srcCompat="@drawable/v_refresh_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -64,7 +66,8 @@
android:visibility="gone"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_download_dark_x24" />
app:srcCompat="@drawable/v_download_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -73,7 +76,8 @@
android:visibility="gone"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_delete_dark_x24" />
app:srcCompat="@drawable/v_delete_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -82,7 +86,8 @@
android:visibility="gone"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_folder_move_dark_x24" />
app:srcCompat="@drawable/v_folder_move_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -81,7 +81,7 @@
android:paddingRight="@dimen/corner_fab_margin"
android:paddingBottom="@dimen/corner_fab_margin">
<com.google.android.material.floatingactionbutton.FloatingActionButton xmlns:app="http://schemas.android.com/apk/res-auto"
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content"
@@ -39,7 +39,7 @@
android:layout_marginTop="@dimen/gallery_search_bar_margin_v"
android:layout_marginRight="@dimen/gallery_search_bar_margin_h" />
<com.hippo.widget.FabLayout xmlns:app="http://schemas.android.com/apk/res-auto"
<com.hippo.widget.FabLayout
android:id="@+id/fab_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -52,7 +52,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_go_to_dark_x24" />
app:srcCompat="@drawable/v_go_to_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -60,7 +61,8 @@
android:layout_height="wrap_content"
app:backgroundTint="?attr/widgetColorThemeAccent"
app:fabSize="mini"
app:srcCompat="@drawable/v_refresh_dark_x24" />
app:srcCompat="@drawable/v_refresh_dark_x24"
app:tint="#fff" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
@@ -71,7 +73,7 @@
</com.hippo.widget.FabLayout>
<com.hippo.widget.FabLayout xmlns:app="http://schemas.android.com/apk/res-auto"
<com.hippo.widget.FabLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingRight="@dimen/corner_fab_margin"
+1 -1
View File
@@ -1,4 +1,4 @@
<resources>
<style name="ToolbarPopupTheme" parent="ThemeOverlay.MaterialComponents.Light" />
<style name="ToolbarPopupTheme" parent="ThemeOverlay.MaterialComponents.Dark"/>
</resources>
+1 -1
View File
@@ -21,7 +21,7 @@
</style>
<!-- TextAppearance -->
<style name="TextAppearance" parent="TextAppearance.AppCompat"></style>
<style name="TextAppearance" parent="TextAppearance.AppCompat" />
<!-- Progress View -->
<style name="ProgressView">
@@ -14,6 +14,8 @@
~ limitations under the License.
-->
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
<network-security-config xmlns:tools="http://schemas.android.com/tools">
<base-config
cleartextTrafficPermitted="true"
tools:ignore="InsecureBaseConfiguration" />
</network-security-config>