mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2025-12-24 15:47:53 -05:00
Compare commits
1 Commits
fix/bumpCo
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dfa6206ad |
@@ -37,7 +37,7 @@ import android.widget.Toast;
|
||||
import com.google.android.material.chip.Chip;
|
||||
import com.google.android.material.chip.ChipGroup;
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.jaredrummler.android.colorpicker.ColorPickerDialog;
|
||||
@@ -113,6 +113,8 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
public static final String BUNDLE_BARCODETYPE = "barcodeType";
|
||||
public static final String BUNDLE_ADDGROUP = "addGroup";
|
||||
|
||||
ExtendedFloatingActionButton saveButton;
|
||||
|
||||
TabLayout tabs;
|
||||
|
||||
ImageView thumbnail;
|
||||
@@ -894,7 +896,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
cardImageFrontHolder.setOnClickListener(new ChooseCardImage());
|
||||
cardImageBackHolder.setOnClickListener(new ChooseCardImage());
|
||||
|
||||
FloatingActionButton saveButton = findViewById(R.id.fabSave);
|
||||
saveButton = findViewById(R.id.fabSave);
|
||||
saveButton.setOnClickListener(v -> doSave());
|
||||
saveButton.bringToFront();
|
||||
|
||||
@@ -1265,6 +1267,10 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
// Validation done, save
|
||||
saveButton.setText(R.string.saving);
|
||||
saveButton.setIcon(null);
|
||||
|
||||
List<Group> selectedGroups = new ArrayList<>();
|
||||
|
||||
for (Integer chipId : groupsChips.getCheckedChipIds()) {
|
||||
|
||||
@@ -33,7 +33,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
@@ -96,7 +96,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
String barcodeIdString;
|
||||
CatimaBarcode format;
|
||||
|
||||
FloatingActionButton editButton;
|
||||
ExtendedFloatingActionButton editButton;
|
||||
|
||||
Guideline centerGuideline;
|
||||
SeekBar barcodeScaler;
|
||||
@@ -578,14 +578,14 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
bottomSheetButton.setColorFilter(textColor);
|
||||
int complementaryColor = Utils.getComplementaryColor(darkenedColor);
|
||||
editButton.setBackgroundTintList(ColorStateList.valueOf(complementaryColor));
|
||||
Drawable editButtonIcon = editButton.getDrawable();
|
||||
Drawable editButtonIcon = editButton.getIcon();
|
||||
editButtonIcon.mutate();
|
||||
if (Utils.needsDarkForeground(complementaryColor)) {
|
||||
editButtonIcon.setTint(ContextCompat.getColor(this, R.color.md_theme_light_onBackground));
|
||||
} else {
|
||||
editButtonIcon.setTint(ContextCompat.getColor(this, R.color.md_theme_dark_onBackground));
|
||||
}
|
||||
editButton.setImageDrawable(editButtonIcon);
|
||||
editButton.setIcon(editButtonIcon);
|
||||
|
||||
Bitmap icon = Utils.retrieveCardImage(this, loyaltyCard.id, ImageLocationType.icon);
|
||||
if (icon != null) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import androidx.core.splashscreen.SplashScreen;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.color.DynamicColors;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -353,7 +353,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
updateLoyaltyCardList();
|
||||
// End of active tab logic
|
||||
|
||||
FloatingActionButton addButton = findViewById(R.id.fabAdd);
|
||||
ExtendedFloatingActionButton addButton = findViewById(R.id.fabAdd);
|
||||
addButton.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(getApplicationContext(), ScanActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
@@ -13,7 +13,7 @@ import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
FloatingActionButton addButton = findViewById(R.id.fabAdd);
|
||||
ExtendedFloatingActionButton addButton = findViewById(R.id.fabAdd);
|
||||
addButton.setOnClickListener(v -> createGroup());
|
||||
addButton.bringToFront();
|
||||
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="protect.card_locker.ManageGroupActivity">
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fabSave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:srcCompat="@drawable/save_24dp"
|
||||
android:contentDescription="@string/save"
|
||||
app:icon="@drawable/save_24dp"
|
||||
android:text="@string/save"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fabSave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:srcCompat="@drawable/save_24dp"
|
||||
android:contentDescription="@string/save"
|
||||
app:icon="@drawable/save_24dp"
|
||||
android:text="@string/save"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
android:layout_height="fill_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fabEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:srcCompat="@drawable/ic_mode_edit_white_24dp"
|
||||
android:contentDescription="@string/edit"
|
||||
app:icon="@drawable/ic_mode_edit_white_24dp"
|
||||
android:text="@string/edit_card"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<FrameLayout
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="protect.card_locker.MainActivity">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fabAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp"
|
||||
android:contentDescription="@string/action_add"
|
||||
app:icon="@drawable/ic_add_white_24dp"
|
||||
android:text="@string/action_add"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="protect.card_locker.ManageGroupsActivity">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fabAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp"
|
||||
android:contentDescription="@string/action_add"
|
||||
app:icon="@drawable/ic_add_white_24dp"
|
||||
android:text="@string/action_add"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="action_search">Search</string>
|
||||
<string name="action_add">Add</string>
|
||||
<string name="action_add">Add card</string>
|
||||
<plurals name="selectedCardCount">
|
||||
<item quantity="one"><xliff:g>%d</xliff:g> selected</item>
|
||||
<item quantity="other"><xliff:g>%d</xliff:g> selected</item>
|
||||
@@ -18,8 +18,9 @@
|
||||
<string name="star">Add to favorites</string>
|
||||
<string name="unstar">Remove from favorites</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="save">Save changes</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="edit_card">Edit card</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="confirm">Confirm</string>
|
||||
<string name="lockScreen">Block Rotation</string>
|
||||
@@ -268,4 +269,5 @@
|
||||
<string name="options">Options</string>
|
||||
<string name="starred">Starred</string>
|
||||
<string name="set_scale">Set scale</string>
|
||||
<string name="saving">Saving...</string>
|
||||
</resources>
|
||||
@@ -28,7 +28,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.textfield.MaterialAutoCompleteTextView;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
@@ -1218,7 +1218,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
ImageButton maximizeButton = activity.findViewById(R.id.maximizeButton);
|
||||
ImageButton minimizeButton = activity.findViewById(R.id.minimizeButton);
|
||||
LinearLayout dotIndicator = activity.findViewById(R.id.dotIndicator);
|
||||
FloatingActionButton editButton = activity.findViewById(R.id.fabEdit);
|
||||
ExtendedFloatingActionButton editButton = activity.findViewById(R.id.fabEdit);
|
||||
SeekBar barcodeScaler = activity.findViewById(R.id.barcodeScaler);
|
||||
|
||||
// Android should not be in fullscreen mode
|
||||
@@ -1322,7 +1322,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
View bottomSheet = activity.findViewById(R.id.bottom_sheet);
|
||||
ImageButton maximizeButton = activity.findViewById(R.id.maximizeButton);
|
||||
ImageButton minimizeButton = activity.findViewById(R.id.minimizeButton);
|
||||
FloatingActionButton editButton = activity.findViewById(R.id.fabEdit);
|
||||
ExtendedFloatingActionButton editButton = activity.findViewById(R.id.fabEdit);
|
||||
SeekBar barcodeScaler = activity.findViewById(R.id.barcodeScaler);
|
||||
|
||||
// Android should not be in fullscreen mode
|
||||
|
||||
Reference in New Issue
Block a user