Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e781e00256 | ||
|
|
e630333e8d | ||
|
|
7eb827a219 | ||
|
|
e251b4bc01 | ||
|
|
644f9e1f78 | ||
|
|
396d90c499 | ||
|
|
ff6e93ea2c | ||
|
|
fb97617de6 | ||
|
|
ff47ab0a04 | ||
|
|
ff98dae886 | ||
|
|
deae7681f8 | ||
|
|
849c1d8bec | ||
|
|
b88f0e9a82 | ||
|
|
5ea2972ca1 | ||
|
|
08ad6aaa85 | ||
|
|
8ba32a0196 | ||
|
|
68ce3ce01c | ||
|
|
fb47beb380 | ||
|
|
73a1464d5b | ||
|
|
75b1225b38 | ||
|
|
07a4c4b7a4 | ||
|
|
cbf9295225 | ||
|
|
19d7fae814 | ||
|
|
d9db571362 | ||
|
|
91e44d9418 | ||
|
|
e30b95dd6c | ||
|
|
ddf27e619d | ||
|
|
ebbcbf324f | ||
|
|
c161d4d781 | ||
|
|
da01730c73 | ||
|
|
f0d76f1bc2 | ||
|
|
3d5b1d00f0 | ||
|
|
a098839060 | ||
|
|
d3fac95701 | ||
|
|
37590dc5ee |
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## v2.19.0 - 113
|
||||
|
||||
- Add previous and next buttons to the loyalty card view
|
||||
- Fix foreground colour on edit button
|
||||
- Replace floppy disk save icon with checkmark
|
||||
|
||||
## v2.18.2 - 112
|
||||
|
||||
- Make the possibility to set a custom header more visible
|
||||
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
applicationId "me.hackerchick.catima"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
versionCode 112
|
||||
versionName "2.18.2"
|
||||
versionCode 113
|
||||
versionName "2.19.0"
|
||||
|
||||
vectorDrawables.useSupportLibrary true
|
||||
multiDexEnabled true
|
||||
|
||||
@@ -8,10 +8,15 @@ import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.util.Linkify;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.GestureDetector;
|
||||
@@ -19,7 +24,6 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.Window;
|
||||
@@ -31,9 +35,22 @@ import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Guideline;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.graphics.BlendModeColorFilterCompat;
|
||||
import androidx.core.graphics.BlendModeCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.bottomappbar.BottomAppBar;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -43,20 +60,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Guideline;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import protect.card_locker.async.TaskHandler;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
@@ -68,14 +71,10 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
CoordinatorLayout coordinatorLayout;
|
||||
ConstraintLayout mainLayout;
|
||||
TextView cardIdFieldView;
|
||||
BottomSheetBehavior behavior;
|
||||
LinearLayout bottomSheet;
|
||||
NestedScrollView bottomSheetContentWrapper;
|
||||
ImageView bottomSheetButton;
|
||||
TextView noteView;
|
||||
TextView groupsView;
|
||||
TextView balanceView;
|
||||
TextView expiryView;
|
||||
BottomAppBar bottomAppBar;
|
||||
ImageButton bottomAppBarInfoButton;
|
||||
ImageButton bottomAppBarPreviousButton;
|
||||
ImageButton bottomAppBarNextButton;
|
||||
AppCompatTextView storeName;
|
||||
ImageButton maximizeButton;
|
||||
ImageView mainImage;
|
||||
@@ -84,10 +83,14 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
View collapsingToolbarLayout;
|
||||
AppBarLayout appBarLayout;
|
||||
ImageView iconImage;
|
||||
Toolbar portraitToolbar;
|
||||
Toolbar landscapeToolbar;
|
||||
|
||||
int loyaltyCardId;
|
||||
ArrayList<Integer> cardList;
|
||||
|
||||
LoyaltyCard loyaltyCard;
|
||||
List<Group> loyaltyCardGroups;
|
||||
boolean rotationEnabled;
|
||||
SQLiteDatabase database;
|
||||
ImportURIHelper importURIHelper;
|
||||
@@ -113,11 +116,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
private ImageView[] dots;
|
||||
boolean isBarcodeSupported = true;
|
||||
|
||||
int bottomSheetState;
|
||||
|
||||
static final String STATE_IMAGEINDEX = "imageIndex";
|
||||
static final String STATE_FULLSCREEN = "isFullscreen";
|
||||
static final String STATE_BOTTOMSHEET = "bottomSheetState";
|
||||
|
||||
private final int HEADER_FILTER_ALPHA = 127;
|
||||
|
||||
@@ -207,6 +207,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
private void extractIntentFields(Intent intent) {
|
||||
final Bundle b = intent.getExtras();
|
||||
loyaltyCardId = b != null ? b.getInt("id") : 0;
|
||||
cardList = b != null ? b.getIntegerArrayList("cardList") : null;
|
||||
Log.d(TAG, "View activity: id=" + loyaltyCardId);
|
||||
}
|
||||
|
||||
@@ -227,6 +228,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
Drawable unwrappedIcon = AppCompatResources.getDrawable(this, icon);
|
||||
assert unwrappedIcon != null;
|
||||
Drawable wrappedIcon = DrawableCompat.wrap(unwrappedIcon);
|
||||
wrappedIcon.mutate();
|
||||
if (dark) {
|
||||
DrawableCompat.setTint(wrappedIcon, Color.BLACK);
|
||||
} else {
|
||||
@@ -249,6 +251,18 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (savedInstanceState == null) {
|
||||
Intent incomingIntent = getIntent();
|
||||
int transitionRight = incomingIntent.getExtras().getInt("transition_right", -1);
|
||||
if (transitionRight == 1) {
|
||||
// right side transition
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
} else if (transitionRight == 0) {
|
||||
// left side transition
|
||||
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
|
||||
}
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
settings = new Settings(this);
|
||||
@@ -267,10 +281,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
if (savedInstanceState != null) {
|
||||
mainImageIndex = savedInstanceState.getInt(STATE_IMAGEINDEX);
|
||||
isFullscreen = savedInstanceState.getBoolean(STATE_FULLSCREEN);
|
||||
bottomSheetState = savedInstanceState.getInt(STATE_BOTTOMSHEET);
|
||||
}
|
||||
|
||||
|
||||
extractIntentFields(getIntent());
|
||||
|
||||
setContentView(R.layout.loyalty_card_view_layout);
|
||||
@@ -281,13 +293,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
coordinatorLayout = findViewById(R.id.coordinator_layout);
|
||||
mainLayout = findViewById(R.id.mainLayout);
|
||||
cardIdFieldView = findViewById(R.id.cardIdView);
|
||||
bottomSheet = findViewById(R.id.bottom_sheet);
|
||||
bottomSheetContentWrapper = findViewById(R.id.bottomSheetContentWrapper);
|
||||
bottomSheetButton = findViewById(R.id.bottomSheetButton);
|
||||
noteView = findViewById(R.id.noteView);
|
||||
groupsView = findViewById(R.id.groupsView);
|
||||
balanceView = findViewById(R.id.balanceView);
|
||||
expiryView = findViewById(R.id.expiryView);
|
||||
storeName = findViewById(R.id.storeName);
|
||||
maximizeButton = findViewById(R.id.maximizeButton);
|
||||
mainImage = findViewById(R.id.mainImage);
|
||||
@@ -296,9 +301,15 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
minimizeButton = findViewById(R.id.minimizeButton);
|
||||
collapsingToolbarLayout = findViewById(R.id.collapsingToolbarLayout);
|
||||
appBarLayout = findViewById(R.id.app_bar_layout);
|
||||
bottomAppBar = findViewById(R.id.bottom_app_bar);
|
||||
iconImage = findViewById(R.id.icon_image);
|
||||
portraitToolbar = findViewById(R.id.toolbar);
|
||||
landscapeToolbar = findViewById(R.id.toolbar_landscape);
|
||||
|
||||
bottomAppBarInfoButton = findViewById(R.id.button_show_info);
|
||||
bottomAppBarPreviousButton = findViewById(R.id.button_previous);
|
||||
bottomAppBarNextButton = findViewById(R.id.button_next);
|
||||
|
||||
barcodeImageGenerationFinishedCallback = () -> {
|
||||
if (!(boolean) mainImage.getTag()) {
|
||||
mainImage.setVisibility(View.GONE);
|
||||
@@ -363,33 +374,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
});
|
||||
editButton.bringToFront();
|
||||
|
||||
behavior = BottomSheetBehavior.from(bottomSheet);
|
||||
behavior.addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
||||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||
changeUiToBottomSheetState(newState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||
}
|
||||
});
|
||||
|
||||
bottomSheetButton.setOnClickListener(v -> {
|
||||
if (behavior.getState() == BottomSheetBehavior.STATE_EXPANDED) {
|
||||
behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
} else {
|
||||
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
});
|
||||
|
||||
appBarLayout.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
adjustLayoutHeights();
|
||||
}
|
||||
});
|
||||
|
||||
appBarLayout.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
@@ -398,61 +382,144 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
}
|
||||
});
|
||||
|
||||
bottomAppBarInfoButton.setOnClickListener(view -> showInfoDialog());
|
||||
bottomAppBarPreviousButton.setOnClickListener(view -> prevNextCard(false));
|
||||
bottomAppBarNextButton.setOnClickListener(view -> prevNextCard(true));
|
||||
|
||||
mGestureDetector = new GestureDetector(this, this);
|
||||
View.OnTouchListener gestureTouchListener = (v, event) -> mGestureDetector.onTouchEvent(event);
|
||||
mainImage.setOnTouchListener(gestureTouchListener);
|
||||
}
|
||||
|
||||
private void changeUiToBottomSheetState(int newState) {
|
||||
if (newState == BottomSheetBehavior.STATE_DRAGGING) {
|
||||
editButton.hide();
|
||||
} else if (newState == BottomSheetBehavior.STATE_EXPANDED) {
|
||||
bottomSheetButton.setImageResource(R.drawable.ic_baseline_arrow_drop_down_24);
|
||||
bottomSheetButton.setContentDescription(getString(R.string.hideMoreInfo));
|
||||
mainLayout.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
|
||||
editButton.hide();
|
||||
} else if (newState == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
bottomSheetButton.setImageResource(R.drawable.ic_baseline_arrow_drop_up_24);
|
||||
bottomSheetButton.setContentDescription(getString(R.string.showMoreInfo));
|
||||
mainLayout.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
|
||||
if (!isFullscreen) {
|
||||
editButton.show();
|
||||
}
|
||||
|
||||
// Scroll bottomsheet content back to top
|
||||
bottomSheetContentWrapper.setScrollY(0);
|
||||
}
|
||||
bottomSheetState = newState;
|
||||
}
|
||||
|
||||
private void adjustLayoutHeights() {
|
||||
// use getLayoutParams instead of getHeight when heights are pre-determined in xml! getHeight could return 0 if a View is not inflated
|
||||
if (appBarLayout.getHeight() != 0 && iconImage.getLayoutParams().height != appBarLayout.getHeight()) {
|
||||
Log.d("adjustLayoutHeights", "setting imageIcon height from: " + iconImage.getLayoutParams().height + " to: " + appBarLayout.getHeight());
|
||||
iconImage.setLayoutParams(new CoordinatorLayout.LayoutParams(
|
||||
CoordinatorLayout.LayoutParams.MATCH_PARENT, appBarLayout.getHeight())
|
||||
);
|
||||
}
|
||||
int bottomSheetHeight = getResources().getDisplayMetrics().heightPixels - appBarLayout.getHeight() - bottomSheetButton.getLayoutParams().height;
|
||||
ViewGroup.LayoutParams params = bottomSheetContentWrapper.getLayoutParams();
|
||||
if (params.height != bottomSheetHeight || params.width != LinearLayout.LayoutParams.MATCH_PARENT) {
|
||||
// XXX android 5 - 9 has so much quirks with setting bottomSheetContent height
|
||||
// just invalidate the wrapper works on 10 onward
|
||||
// bottomSheetContentWrapper.invalidate();
|
||||
// The below worked on android 5 but not 6, reloading the card then it breaks again on 6, entirely random :(
|
||||
// for (int i = 0; i < bottomSheetContentWrapper.getChildCount(); i++) {
|
||||
// bottomSheetContentWrapper.getChildAt(i).invalidate();
|
||||
// }
|
||||
// since it's basically allergic to getting enlarged then shrunk again, and setting it at all when fullscreen makes no sense
|
||||
if (!isFullscreen) {
|
||||
Log.d("adjustLayoutHeights", "setting bottomSheet height from: " + params.height + " to: " + bottomSheetHeight);
|
||||
bottomSheetContentWrapper.setLayoutParams(
|
||||
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, bottomSheetHeight)
|
||||
appBarLayout.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
iconImage.setLayoutParams(new CoordinatorLayout.LayoutParams(
|
||||
CoordinatorLayout.LayoutParams.MATCH_PARENT, appBarLayout.getHeight())
|
||||
);
|
||||
iconImage.setClipBounds(new Rect(left, top, right, bottom));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private SpannableStringBuilder padSpannableString(SpannableStringBuilder spannableStringBuilder) {
|
||||
if (spannableStringBuilder.length() > 0) {
|
||||
spannableStringBuilder.append("\n\n");
|
||||
}
|
||||
|
||||
return spannableStringBuilder;
|
||||
}
|
||||
|
||||
private boolean hasBalance(LoyaltyCard loyaltyCard) {
|
||||
return !loyaltyCard.balance.equals(new BigDecimal(0));
|
||||
}
|
||||
|
||||
private void showInfoDialog() {
|
||||
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
||||
|
||||
TextView infoTitleView = new TextView(this);
|
||||
infoTitleView.setPadding(20, 20, 20, 20);
|
||||
infoTitleView.setTextSize(settings.getFontSizeMax(settings.getMediumFont()));
|
||||
infoTitleView.setText(loyaltyCard.store);
|
||||
infoDialog.setCustomTitle(infoTitleView);
|
||||
infoDialog.setTitle(loyaltyCard.store);
|
||||
|
||||
TextView infoTextview = new TextView(this);
|
||||
infoTextview.setPadding(20, 0, 20, 0);
|
||||
infoTextview.setAutoLinkMask(Linkify.ALL);
|
||||
infoTextview.setTextIsSelectable(true);
|
||||
|
||||
SpannableStringBuilder infoText = new SpannableStringBuilder();
|
||||
if (!loyaltyCard.note.isEmpty()) {
|
||||
infoText.append(loyaltyCard.note);
|
||||
}
|
||||
|
||||
if (loyaltyCardGroups.size() > 0) {
|
||||
List<String> groupNames = new ArrayList<>();
|
||||
for (Group group : loyaltyCardGroups) {
|
||||
groupNames.add(group._id);
|
||||
}
|
||||
|
||||
padSpannableString(infoText);
|
||||
infoText.append(getString(R.string.groupsList, TextUtils.join(", ", groupNames)));
|
||||
}
|
||||
|
||||
if (hasBalance(loyaltyCard)) {
|
||||
padSpannableString(infoText);
|
||||
infoText.append(getString(R.string.balanceSentence, Utils.formatBalance(this, loyaltyCard.balance, loyaltyCard.balanceType)));
|
||||
}
|
||||
|
||||
if (loyaltyCard.expiry != null) {
|
||||
String formattedExpiry = DateFormat.getDateInstance(DateFormat.LONG).format(loyaltyCard.expiry);
|
||||
|
||||
padSpannableString(infoText);
|
||||
if (Utils.hasExpired(loyaltyCard.expiry)) {
|
||||
int start = infoText.length();
|
||||
|
||||
infoText.append(getString(R.string.expiryStateSentenceExpired, formattedExpiry));
|
||||
infoText.setSpan(new ForegroundColorSpan(Color.RED), start, infoText.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
} else {
|
||||
infoText.append(getString(R.string.expiryStateSentence, formattedExpiry));
|
||||
}
|
||||
}
|
||||
|
||||
infoTextview.setText(infoText);
|
||||
|
||||
infoDialog.setView(infoTextview);
|
||||
infoDialog.setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss());
|
||||
infoDialog.create().show();
|
||||
}
|
||||
|
||||
private void setBottomAppBarButtonState() {
|
||||
if (!loyaltyCard.note.isEmpty() || !loyaltyCardGroups.isEmpty() || hasBalance(loyaltyCard) || loyaltyCard.expiry != null) {
|
||||
bottomAppBarInfoButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
bottomAppBarInfoButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (cardList == null || cardList.size() == 1) {
|
||||
bottomAppBarPreviousButton.setVisibility(View.GONE);
|
||||
bottomAppBarNextButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
bottomAppBarPreviousButton.setVisibility(View.VISIBLE);
|
||||
bottomAppBarNextButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void prevNextCard(boolean next) {
|
||||
// If we're in RTL layout, we want the "left" button to be "next" instead of "previous"
|
||||
// So we swap next around
|
||||
boolean transitionRight = next;
|
||||
if (getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
|
||||
next = !next;
|
||||
}
|
||||
|
||||
int cardListPosition = cardList.indexOf(loyaltyCardId);
|
||||
|
||||
if (next) {
|
||||
if (cardListPosition == cardList.size() - 1) {
|
||||
cardListPosition = 0;
|
||||
} else {
|
||||
cardListPosition = cardListPosition + 1;
|
||||
}
|
||||
} else {
|
||||
if (cardListPosition == 0) {
|
||||
cardListPosition = cardList.size() - 1;
|
||||
} else {
|
||||
cardListPosition = cardListPosition - 1;
|
||||
}
|
||||
}
|
||||
|
||||
loyaltyCardId = cardList.get(cardListPosition);
|
||||
|
||||
// Restart activity with new card id and index
|
||||
Intent intent = getIntent();
|
||||
Bundle b = intent.getExtras();
|
||||
b.putInt("id", loyaltyCardId);
|
||||
b.putInt("transition_right", transitionRight ? 1 : 0);
|
||||
intent.putExtras(b);
|
||||
intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
@@ -466,7 +533,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
public void onSaveInstanceState(Bundle savedInstanceState) {
|
||||
savedInstanceState.putInt(STATE_IMAGEINDEX, mainImageIndex);
|
||||
savedInstanceState.putBoolean(STATE_FULLSCREEN, isFullscreen);
|
||||
savedInstanceState.putInt(STATE_BOTTOMSHEET, bottomSheetState);
|
||||
super.onSaveInstanceState(savedInstanceState);
|
||||
}
|
||||
|
||||
@@ -508,6 +574,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
return;
|
||||
}
|
||||
|
||||
loyaltyCardGroups = DBHelper.getLoyaltyCardGroups(database, loyaltyCardId);
|
||||
|
||||
setupOrientation();
|
||||
|
||||
format = loyaltyCard.barcodeType;
|
||||
@@ -519,56 +587,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
settings.getFontSizeMin(settings.getLargeFont()), settings.getFontSizeMax(settings.getLargeFont()),
|
||||
1, TypedValue.COMPLEX_UNIT_SP);
|
||||
|
||||
if (loyaltyCard.note.length() > 0) {
|
||||
noteView.setVisibility(View.VISIBLE);
|
||||
noteView.setText(loyaltyCard.note);
|
||||
noteView.setTextSize(settings.getFontSizeMax(settings.getMediumFont()));
|
||||
} else {
|
||||
noteView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
List<Group> loyaltyCardGroups = DBHelper.getLoyaltyCardGroups(database, loyaltyCardId);
|
||||
|
||||
if (loyaltyCardGroups.size() > 0) {
|
||||
List<String> groupNames = new ArrayList<>();
|
||||
for (Group group : loyaltyCardGroups) {
|
||||
groupNames.add(group._id);
|
||||
}
|
||||
|
||||
groupsView.setVisibility(View.VISIBLE);
|
||||
groupsView.setText(getString(R.string.groupsList, TextUtils.join(", ", groupNames)));
|
||||
groupsView.setTextSize(settings.getFontSizeMax(settings.getMediumFont()));
|
||||
} else {
|
||||
groupsView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!loyaltyCard.balance.equals(new BigDecimal(0))) {
|
||||
balanceView.setVisibility(View.VISIBLE);
|
||||
balanceView.setText(getString(R.string.balanceSentence, Utils.formatBalance(this, loyaltyCard.balance, loyaltyCard.balanceType)));
|
||||
balanceView.setTextSize(settings.getFontSizeMax(settings.getMediumFont()));
|
||||
} else {
|
||||
balanceView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (loyaltyCard.expiry != null) {
|
||||
expiryView.setVisibility(View.VISIBLE);
|
||||
|
||||
int expiryString = R.string.expiryStateSentence;
|
||||
if (Utils.hasExpired(loyaltyCard.expiry)) {
|
||||
expiryString = R.string.expiryStateSentenceExpired;
|
||||
expiryView.setTextColor(Color.RED);
|
||||
}
|
||||
expiryView.setText(getString(expiryString, DateFormat.getDateInstance(DateFormat.LONG).format(loyaltyCard.expiry)));
|
||||
expiryView.setTextSize(settings.getFontSizeMax(settings.getMediumFont()));
|
||||
} else {
|
||||
expiryView.setVisibility(View.GONE);
|
||||
}
|
||||
expiryView.setTag(loyaltyCard.expiry);
|
||||
|
||||
if (!isFullscreen) {
|
||||
makeBottomSheetVisibleIfUseful();
|
||||
}
|
||||
|
||||
storeName.setText(loyaltyCard.store);
|
||||
storeName.setTextSize(settings.getFontSizeMax(settings.getLargeFont()));
|
||||
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(
|
||||
@@ -600,22 +618,14 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
barcodeScaler.setThumbTintList(ColorStateList.valueOf(darkenedColor));
|
||||
maximizeButton.setBackgroundColor(darkenedColor);
|
||||
minimizeButton.setBackgroundColor(darkenedColor);
|
||||
bottomSheetButton.setBackgroundColor(darkenedColor);
|
||||
bottomAppBar.setBackgroundColor(darkenedColor);
|
||||
maximizeButton.setColorFilter(textColor);
|
||||
minimizeButton.setColorFilter(textColor);
|
||||
bottomSheetButton.setColorFilter(textColor);
|
||||
int complementaryColor = Utils.getComplementaryColor(darkenedColor);
|
||||
editButton.setBackgroundTintList(ColorStateList.valueOf(complementaryColor));
|
||||
Drawable editButtonIcon = editButton.getDrawable();
|
||||
editButtonIcon.mutate();
|
||||
int colorPrimary = MaterialColors.getColor(this, R.attr.colorPrimary, ContextCompat.getColor(this, R.color.md_theme_light_primary));
|
||||
int colorOnPrimary = MaterialColors.getColor(this, R.attr.colorOnPrimary, ContextCompat.getColor(this, R.color.md_theme_light_onPrimary));
|
||||
boolean darkMode = Utils.isDarkModeEnabled(this);
|
||||
if (Utils.needsDarkForeground(complementaryColor)) {
|
||||
editButtonIcon.setTint(darkMode ? colorOnPrimary : colorPrimary);
|
||||
} else {
|
||||
editButtonIcon.setTint(darkMode ? colorPrimary : colorOnPrimary);
|
||||
}
|
||||
editButtonIcon.setTint(Utils.needsDarkForeground(complementaryColor) ? Color.BLACK : Color.WHITE);
|
||||
editButton.setImageDrawable(editButtonIcon);
|
||||
|
||||
Bitmap icon = Utils.retrieveCardImage(this, loyaltyCard.id, ImageLocationType.icon);
|
||||
@@ -639,6 +649,11 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
actionBar.setHomeAsUpIndicator(getIcon(R.drawable.home_arrow_back_white, backgroundNeedsDarkIcons));
|
||||
}
|
||||
|
||||
fixImageButtonColor(bottomAppBarInfoButton);
|
||||
fixImageButtonColor(bottomAppBarPreviousButton);
|
||||
fixImageButtonColor(bottomAppBarNextButton);
|
||||
setBottomAppBarButtonState();
|
||||
|
||||
// Make notification area light if dark icons are needed
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
window.getDecorView().setSystemUiVisibility(backgroundNeedsDarkIcons ? View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : 0);
|
||||
@@ -675,16 +690,17 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
imageTypes.add(ImageType.IMAGE_BACK);
|
||||
}
|
||||
|
||||
setDotIndicator(darkMode);
|
||||
setDotIndicator(Utils.isDarkModeEnabled(this));
|
||||
|
||||
setFullscreen(isFullscreen);
|
||||
|
||||
// restore bottomSheet UI states from changing orientation
|
||||
changeUiToBottomSheetState(bottomSheetState);
|
||||
|
||||
DBHelper.updateLoyaltyCardLastUsed(database, loyaltyCard.id);
|
||||
}
|
||||
|
||||
private void fixImageButtonColor(ImageButton imageButton) {
|
||||
imageButton.setColorFilter(BlendModeColorFilterCompat.createBlendModeColorFilterCompat(backgroundNeedsDarkIcons ? Color.BLACK : Color.WHITE, BlendModeCompat.SRC_ATOP));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (isFullscreen) {
|
||||
@@ -698,14 +714,12 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.card_view_menu, menu);
|
||||
loyaltyCard = DBHelper.getLoyaltyCard(database, loyaltyCardId);
|
||||
starred = loyaltyCard.starStatus != 0;
|
||||
|
||||
if(loyaltyCard.archiveStatus != 0){
|
||||
if (loyaltyCard.archiveStatus != 0) {
|
||||
menu.findItem(R.id.action_unarchive).setVisible(true);
|
||||
menu.findItem(R.id.action_archive).setVisible(false);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
menu.findItem(R.id.action_unarchive).setVisible(false);
|
||||
menu.findItem(R.id.action_archive).setVisible(true);
|
||||
}
|
||||
@@ -734,75 +748,75 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
|
||||
switch (id) {
|
||||
case android.R.id.home:
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
} else if (id == R.id.action_share) {
|
||||
try {
|
||||
importURIHelper.startShareIntent(Arrays.asList(loyaltyCard));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.failedGeneratingShareURL, Toast.LENGTH_LONG).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (id == R.id.action_duplicate) {
|
||||
Intent intent = new Intent(getApplicationContext(), LoyaltyCardEditActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("id", loyaltyCardId);
|
||||
bundle.putBoolean("duplicateId", true);
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
|
||||
return true;
|
||||
} else if (id == R.id.action_star_unstar) {
|
||||
starred = !starred;
|
||||
DBHelper.updateLoyaltyCardStarStatus(database, loyaltyCardId, starred ? 1 : 0);
|
||||
|
||||
// Re-init loyaltyCard with new data from DB
|
||||
onResume();
|
||||
|
||||
return true;
|
||||
} else if (id == R.id.action_archive) {
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(database, loyaltyCardId, 1);
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.archived, Toast.LENGTH_LONG).show();
|
||||
|
||||
// Re-init loyaltyCard with new data from DB
|
||||
onResume();
|
||||
|
||||
return true;
|
||||
} else if (id == R.id.action_unarchive) {
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(database, loyaltyCardId, 0);
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.unarchived, Toast.LENGTH_LONG).show();
|
||||
|
||||
// Re-init loyaltyCard with new data from DB
|
||||
onResume();
|
||||
|
||||
return true;
|
||||
} else if (id == R.id.action_delete) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.deleteTitle);
|
||||
builder.setMessage(R.string.deleteConfirmation);
|
||||
builder.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||
Log.e(TAG, "Deleting card: " + loyaltyCardId);
|
||||
|
||||
DBHelper.deleteLoyaltyCard(database, LoyaltyCardViewActivity.this, loyaltyCardId);
|
||||
|
||||
ShortcutHelper.removeShortcut(LoyaltyCardViewActivity.this, loyaltyCardId);
|
||||
|
||||
finish();
|
||||
break;
|
||||
dialog.dismiss();
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
|
||||
case R.id.action_share:
|
||||
try {
|
||||
importURIHelper.startShareIntent(Arrays.asList(loyaltyCard));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.failedGeneratingShareURL, Toast.LENGTH_LONG).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
|
||||
case R.id.action_duplicate:
|
||||
loyaltyCard = DBHelper.getLoyaltyCard(database, loyaltyCardId);
|
||||
Intent intent = new Intent(getApplicationContext(), LoyaltyCardEditActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("id", loyaltyCardId);
|
||||
bundle.putBoolean("duplicateId", true);
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
|
||||
case R.id.action_star_unstar:
|
||||
starred = !starred;
|
||||
DBHelper.updateLoyaltyCardStarStatus(database, loyaltyCardId, starred ? 1 : 0);
|
||||
invalidateOptionsMenu();
|
||||
return true;
|
||||
|
||||
case R.id.action_archive:
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(database, loyaltyCardId, 1);
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.archived, Toast.LENGTH_LONG).show();
|
||||
invalidateOptionsMenu();
|
||||
return true;
|
||||
|
||||
case R.id.action_unarchive:
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(database, loyaltyCardId, 0);
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.unarchived, Toast.LENGTH_LONG).show();
|
||||
invalidateOptionsMenu();
|
||||
return true;
|
||||
|
||||
case R.id.action_delete:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.deleteTitle);
|
||||
builder.setMessage(R.string.deleteConfirmation);
|
||||
builder.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||
Log.e(TAG, "Deleting card: " + loyaltyCardId);
|
||||
|
||||
DBHelper.deleteLoyaltyCard(database, LoyaltyCardViewActivity.this, loyaltyCardId);
|
||||
|
||||
ShortcutHelper.removeShortcut(LoyaltyCardViewActivity.this, loyaltyCardId);
|
||||
|
||||
finish();
|
||||
dialog.dismiss();
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void setupOrientation() {
|
||||
Toolbar portraitToolbar = findViewById(R.id.toolbar);
|
||||
|
||||
int orientation = getResources().getConfiguration().orientation;
|
||||
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
Log.d(TAG, "Detected landscape mode");
|
||||
@@ -831,14 +845,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
}
|
||||
}
|
||||
|
||||
private void makeBottomSheetVisibleIfUseful() {
|
||||
if (noteView.getVisibility() == View.VISIBLE || groupsView.getVisibility() == View.VISIBLE || balanceView.getVisibility() == View.VISIBLE || expiryView.getVisibility() == View.VISIBLE) {
|
||||
bottomSheet.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
bottomSheet.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawBarcode(boolean addPadding) {
|
||||
mTasks.flushTaskList(TaskHandler.TYPE.BARCODE, true, false, false);
|
||||
if (format != null) {
|
||||
@@ -979,10 +985,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
}
|
||||
|
||||
// Hide toolbars
|
||||
//
|
||||
// Appbar needs to be invisible and have padding removed
|
||||
// Or the barcode will be centered instead of on top of the screen
|
||||
// Don't ask me why...
|
||||
appBarLayout.setVisibility(View.INVISIBLE);
|
||||
iconImage.setVisibility(View.INVISIBLE);
|
||||
collapsingToolbarLayout.setVisibility(View.GONE);
|
||||
@@ -990,12 +992,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
|
||||
// Hide other UI elements
|
||||
cardIdFieldView.setVisibility(View.GONE);
|
||||
bottomSheet.setVisibility(View.GONE);
|
||||
behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
editButton.hide();
|
||||
|
||||
// android 5-9, avoid padding growing on top of bottomSheet
|
||||
coordinatorLayout.removeView(bottomSheet);
|
||||
bottomAppBar.setVisibility(View.GONE);
|
||||
editButton.setVisibility(View.GONE);
|
||||
|
||||
// Set Android to fullscreen mode
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
@@ -1023,15 +1021,14 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
}
|
||||
|
||||
// Show appropriate toolbar
|
||||
// And restore 24dp paddingTop for appBarLayout
|
||||
appBarLayout.setVisibility(View.VISIBLE);
|
||||
setupOrientation();
|
||||
iconImage.setVisibility(View.VISIBLE);
|
||||
|
||||
// Show other UI elements
|
||||
cardIdFieldView.setVisibility(View.VISIBLE);
|
||||
makeBottomSheetVisibleIfUseful();
|
||||
editButton.show();
|
||||
editButton.setVisibility(View.VISIBLE);
|
||||
bottomAppBar.setVisibility(View.VISIBLE);
|
||||
|
||||
// Unset fullscreen mode
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
@@ -1039,11 +1036,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
& ~View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
& ~View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
);
|
||||
|
||||
// android 5-9, avoid padding growing on top of bottomSheet
|
||||
if (bottomSheet.getParent() != coordinatorLayout) {
|
||||
coordinatorLayout.addView(bottomSheet);
|
||||
}
|
||||
}
|
||||
|
||||
Log.d("setFullScreen", "Is full screen enabled? " + enabled + " Zoom Level = " + barcodeScaler.getProgress());
|
||||
|
||||
@@ -36,6 +36,16 @@ import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import protect.card_locker.preferences.SettingsActivity;
|
||||
|
||||
public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener, GestureDetector.OnGestureListener {
|
||||
@@ -850,15 +860,22 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
return;
|
||||
}
|
||||
|
||||
Intent i = new Intent(this, LoyaltyCardViewActivity.class);
|
||||
i.setAction("");
|
||||
Intent intent = new Intent(this, LoyaltyCardViewActivity.class);
|
||||
intent.setAction("");
|
||||
final Bundle b = new Bundle();
|
||||
b.putInt("id", loyaltyCard.id);
|
||||
i.putExtras(b);
|
||||
|
||||
ArrayList<Integer> cardList = new ArrayList<>();
|
||||
for (int i = 0; i < mAdapter.getItemCount(); i++) {
|
||||
cardList.add(mAdapter.getCard(i).id);
|
||||
}
|
||||
|
||||
b.putIntegerArrayList("cardList", cardList);
|
||||
intent.putExtras(b);
|
||||
|
||||
ShortcutHelper.updateShortcuts(MainActivity.this, loyaltyCard);
|
||||
|
||||
startActivity(i);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
app/src/main/res/anim/slide_in_left.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- https://stackoverflow.com/questions/5151591/android-left-to-right-slide-animation/5151774#5151774 -->
|
||||
<translate
|
||||
android:duration="200"
|
||||
android:fromXDelta="-100%"
|
||||
android:fromYDelta="0%"
|
||||
android:toXDelta="0%"
|
||||
android:toYDelta="0%" />
|
||||
</set>
|
||||
10
app/src/main/res/anim/slide_in_right.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- https://stackoverflow.com/questions/5151591/android-left-to-right-slide-animation/5151774#5151774 -->
|
||||
<translate
|
||||
android:duration="200"
|
||||
android:fromXDelta="100%"
|
||||
android:fromYDelta="0%"
|
||||
android:toXDelta="0%"
|
||||
android:toYDelta="0%" />
|
||||
</set>
|
||||
10
app/src/main/res/anim/slide_out_left.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- https://stackoverflow.com/questions/5151591/android-left-to-right-slide-animation/5151774#5151774 -->
|
||||
<translate
|
||||
android:duration="200"
|
||||
android:fromXDelta="0%"
|
||||
android:fromYDelta="0%"
|
||||
android:toXDelta="-100%"
|
||||
android:toYDelta="0%" />
|
||||
</set>
|
||||
10
app/src/main/res/anim/slide_out_right.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- https://stackoverflow.com/questions/5151591/android-left-to-right-slide-animation/5151774#5151774 -->
|
||||
<translate
|
||||
android:duration="200"
|
||||
android:fromXDelta="0%"
|
||||
android:fromYDelta="0%"
|
||||
android:toXDelta="100%"
|
||||
android:toYDelta="0%" />
|
||||
</set>
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M15.41,7.41L14,6l-6,6 6,6 1.41,-1.41L10.83,12z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/ic_baseline_info_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" 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"/>
|
||||
</vector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
|
||||
</vector>
|
||||
@@ -7,14 +7,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="protect.card_locker.ManageGroupActivity">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
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:layout_margin="16dp"
|
||||
android:contentDescription="@string/save"
|
||||
android:layout_margin="16dp" />
|
||||
app:srcCompat="@drawable/ic_done" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:srcCompat="@drawable/save_24dp"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="@string/save"
|
||||
android:layout_margin="16dp" />
|
||||
app:srcCompat="@drawable/ic_done" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -8,239 +8,6 @@
|
||||
android:layout_height="fill_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
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"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/mainLayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/centerGuideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scalerGuideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.75"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/maximizeButton"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="0dp"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_up_24"
|
||||
android:contentDescription="@string/moveBarcodeToTopOfScreen"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/mainImage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="?attr/colorPrimary" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mainImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
app:layout_constraintBottom_toTopOf="@+id/centerGuideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/maximizeButton"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/minimizeButton"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="0dp"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_down_24"
|
||||
android:contentDescription="@string/moveBarcodeToCenterOfScreen"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mainImage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dotIndicator"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/minimizeButton"/>
|
||||
|
||||
<SeekBar
|
||||
android:contentDescription="@string/set_scale"
|
||||
android:id="@+id/barcodeScaler"
|
||||
android:visibility="gone"
|
||||
android:max="100"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/inputPadding"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
app:layout_constraintTop_toBottomOf="@+id/scalerGuideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cardIdView"
|
||||
android:enabled="true"
|
||||
android:textIsSelectable="true"
|
||||
android:focusable="true"
|
||||
android:longClickable="true"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="10.0dip"
|
||||
android:layout_marginRight="10.0dip"
|
||||
android:paddingBottom="80dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dotIndicator"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textAlignment="center"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="@dimen/singleCardCardIdTextSizeMin"
|
||||
app:autoSizeMaxTextSize="@dimen/singleCardCardIdTextSizeMax"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/drop_shadow_actionbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="5.0dip"
|
||||
android:layout_gravity="top"/>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:colorBackground"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="0px"
|
||||
android:visibility="gone"
|
||||
app:behavior_hideable="false"
|
||||
app:behavior_peekHeight="80dp"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bottomSheetButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="top|start"
|
||||
android:contentDescription="@string/showMoreInfo"
|
||||
android:scaleType="fitCenter"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_up_24"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
android:background="?attr/colorPrimary" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/bottomSheetContentWrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noteView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="all"
|
||||
android:enabled="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:longClickable="true"
|
||||
android:padding="20dp"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/singleCardNoteTextSizeMin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/groupsView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:longClickable="true"
|
||||
android:padding="20dp"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/singleCardNoteTextSizeMin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/balanceView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:longClickable="true"
|
||||
android:padding="20dp"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/singleCardNoteTextSizeMin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/expiryView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:longClickable="true"
|
||||
android:padding="20dp"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/singleCardNoteTextSizeMin" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="fill_parent"
|
||||
@@ -249,8 +16,7 @@
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:fitsSystemWindows="true"
|
||||
android:weightSum="1.0"
|
||||
>
|
||||
android:weightSum="1.0">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar_landscape"
|
||||
@@ -310,5 +76,202 @@
|
||||
app:srcCompat="@drawable/ic_launcher_foreground"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<FrameLayout
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/mainLayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/centerGuideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scalerGuideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.75"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/maximizeButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:contentDescription="@string/moveBarcodeToTopOfScreen"
|
||||
android:padding="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/mainImage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_up_24"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mainImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
app:layout_constraintBottom_toTopOf="@+id/centerGuideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/maximizeButton"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/minimizeButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:contentDescription="@string/moveBarcodeToCenterOfScreen"
|
||||
android:padding="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mainImage"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_down_24"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dotIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/minimizeButton"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/barcodeScaler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/inputPadding"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:contentDescription="@string/set_scale"
|
||||
android:max="100"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/scalerGuideline" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cardIdView"
|
||||
android:enabled="true"
|
||||
android:textIsSelectable="true"
|
||||
android:focusable="true"
|
||||
android:longClickable="true"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="10.0dip"
|
||||
android:layout_marginRight="10.0dip"
|
||||
android:paddingBottom="80dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dotIndicator"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textAlignment="center"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="@dimen/singleCardCardIdTextSizeMin"
|
||||
app:autoSizeMaxTextSize="@dimen/singleCardCardIdTextSizeMax"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/drop_shadow_actionbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="5.0dip"
|
||||
android:layout_gravity="top"/>
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.bottomappbar.BottomAppBar
|
||||
android:id="@+id/bottom_app_bar"
|
||||
style="@style/Widget.MaterialComponents.BottomAppBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:contentInsetLeft="0dp"
|
||||
app:contentInsetStart="0dp"
|
||||
app:contentInsetRight="0dp"
|
||||
app:contentInsetEnd="0dp"
|
||||
app:fabAlignmentMode="center">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_previous"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="left"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_chevron_left_24"
|
||||
android:tooltipText="@string/previousCard"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_show_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_info_24"
|
||||
android:tooltipText="@string/showMoreInfo"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_chevron_right_24"
|
||||
android:tooltipText="@string/nextCard"
|
||||
android:visibility="gone" />
|
||||
|
||||
</com.google.android.material.bottomappbar.BottomAppBar>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fabEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_mode_edit_white_24dp"
|
||||
android:contentDescription="@string/edit"
|
||||
app:layout_anchor="@id/bottom_app_bar" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -7,21 +7,21 @@ Heimen Stoffels
|
||||
Katharine Chui
|
||||
Oğuz Ersen
|
||||
mondstern
|
||||
Altonss
|
||||
IllusiveMan196
|
||||
Altonss
|
||||
StoyanDimitrov
|
||||
Petr Novák
|
||||
Joel A
|
||||
Taco
|
||||
Gediminas Murauskas
|
||||
Nyatsuki
|
||||
Michael Moroni
|
||||
Nyatsuki
|
||||
SlavekB
|
||||
Samantaz Fox
|
||||
arno-github
|
||||
Ankit Tiwari
|
||||
Sergio Paredes
|
||||
laralem
|
||||
SlavekB
|
||||
huuhaa
|
||||
arshbeerSingh
|
||||
Quentin PAGÈS
|
||||
@@ -35,6 +35,7 @@ betsythefc
|
||||
Silvério Santos
|
||||
waffshappen
|
||||
ati3
|
||||
Giovanni
|
||||
Jane Kong
|
||||
K. Herbert
|
||||
Still Hsu
|
||||
@@ -51,10 +52,10 @@ Astrohops1
|
||||
Clonewayx
|
||||
D. Domig
|
||||
Diego
|
||||
Giovanni
|
||||
Lukas Grassauer
|
||||
Marnick L'Eau
|
||||
Michalis
|
||||
Michał
|
||||
Rosdyana Kusuma
|
||||
umoenks
|
||||
Thomas Bertels
|
||||
@@ -105,3 +106,4 @@ Robin
|
||||
sergio
|
||||
Marcus
|
||||
techwebpd
|
||||
unstartdev
|
||||
|
||||
@@ -245,4 +245,6 @@
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> карта (<xliff:g id="archivedCount">%2$d</xliff:g> архивирана)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> карти (<xliff:g id="archivedCount">%2$d</xliff:g> архивирани)</item>
|
||||
</plurals>
|
||||
<string name="previousCard">Предишна</string>
|
||||
<string name="nextCard">Следваща</string>
|
||||
</resources>
|
||||
@@ -251,4 +251,6 @@
|
||||
<item quantity="few"><xliff:g>%1$d</xliff:g> karty (<xliff:g id="archivedCount">%2$d</xliff:g> archivované)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> karet (<xliff:g id="archivedCount">%2$d</xliff:g> archivovaných)</item>
|
||||
</plurals>
|
||||
<string name="previousCard">Předchozí</string>
|
||||
<string name="nextCard">Následující</string>
|
||||
</resources>
|
||||
@@ -245,4 +245,6 @@
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> Karten (<xliff:g id="archivedCount">%2$d</xliff:g> archiviert)</item>
|
||||
</plurals>
|
||||
<string name="failedLaunchingPhotoPicker">Es konnte keine unterstützte Galerie-Anwendung gefunden werden</string>
|
||||
<string name="previousCard">Vorherige</string>
|
||||
<string name="nextCard">Nächste</string>
|
||||
</resources>
|
||||
@@ -245,4 +245,6 @@
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> carte (<xliff:g id="archivedCount">%2$d</xliff:g> archivée)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> cartes (<xliff:g id="archivedCount">%2$d</xliff:g> archivées)</item>
|
||||
</plurals>
|
||||
<string name="nextCard">Suivant</string>
|
||||
<string name="previousCard">Précédent</string>
|
||||
</resources>
|
||||
@@ -39,7 +39,6 @@
|
||||
<string name="cardShortcut">קיצור דרך</string>
|
||||
<string name="noCardsMessage">תחילה הוסף כרטיס</string>
|
||||
<string name="card_ids_copied">מזהי כרטיס הועתקו</string>
|
||||
<string name="barcodeImageDescriptionWithType"></string>
|
||||
<string name="noStoreError">לא הוכנס שם חנות</string>
|
||||
<string name="noCardExistsError">כרטיס לא נמצא</string>
|
||||
<string name="importExport">ייבוא/ייצוא</string>
|
||||
|
||||
@@ -237,12 +237,14 @@
|
||||
<string name="noUnarchivedCardsMessage">Non esistono schede non archiviate</string>
|
||||
<string name="unarchived">Carta non archiviata</string>
|
||||
<string name="archived">Carta archiviata</string>
|
||||
<string name="settings_portrait_orientation">Ritratto</string>
|
||||
<string name="settings_landscape_orientation">Paesaggio</string>
|
||||
<string name="settings_lock_on_opening_orientation">Blocco da utilizzare per l\'apertura della carta</string>
|
||||
<string name="settings_portrait_orientation">Verticale</string>
|
||||
<string name="settings_landscape_orientation">Orizzontale</string>
|
||||
<string name="settings_lock_on_opening_orientation">Blocca sull\'orientamento utilizzato all\'apertura della carta</string>
|
||||
<string name="failedLaunchingPhotoPicker">Impossibile trovare un\'app galleria supportata</string>
|
||||
<plurals name="groupCardCountWithArchived">
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> scheda (<xliff:g id="archivedCount">%2$d</xliff:g> archiviata)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> schede (<xliff:g id="archivedCount">%2$d</xliff:g> archiviate)</item>
|
||||
</plurals>
|
||||
<string name="previousCard">Precedente</string>
|
||||
<string name="nextCard">Successivo</string>
|
||||
</resources>
|
||||
@@ -240,4 +240,11 @@
|
||||
<string name="archiveList">Arkiv</string>
|
||||
<string name="settings_follow_system_orientation">Følg systemet</string>
|
||||
<string name="settings_portrait_orientation">Stående</string>
|
||||
<string name="failedLaunchingPhotoPicker">Fant ikke noe støttet galleriprogram</string>
|
||||
<string name="previousCard">Forrige</string>
|
||||
<string name="nextCard">Neste</string>
|
||||
<plurals name="groupCardCountWithArchived">
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> kort (<xliff:g id="archivedCount">%2$d</xliff:g> arkivert)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> kort (<xliff:g id="archivedCount">%2$d</xliff:g> arkivert)</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
@@ -245,4 +245,6 @@
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> kaart (<xliff:g id="archivedCount">%2$d</xliff:g> gearchiveerd)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> kaarten (<xliff:g id="archivedCount">%2$d</xliff:g> gearchiveerd)</item>
|
||||
</plurals>
|
||||
<string name="previousCard">Vorige</string>
|
||||
<string name="nextCard">Volgende</string>
|
||||
</resources>
|
||||
@@ -250,4 +250,7 @@
|
||||
<string name="unarchived">Karta odarchiwizowana</string>
|
||||
<string name="archiveList">Archiwum</string>
|
||||
<string name="noUnarchivedCardsMessage">Nie istnieją żadne niezarchiwizowane karty</string>
|
||||
</resources>
|
||||
<string name="failedLaunchingPhotoPicker">Nie można odnaleźć aplikacji galerii</string>
|
||||
<string name="previousCard">Poprzedni</string>
|
||||
<string name="nextCard">Następny</string>
|
||||
</resources>
|
||||
@@ -257,4 +257,6 @@
|
||||
<item quantity="many"><xliff:g>%1$d</xliff:g> карт (<xliff:g id="archivedCount">%2$d</xliff:g> архивировано)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> карт (<xliff:g id="archivedCount">%2$d</xliff:g> архивировано)</item>
|
||||
</plurals>
|
||||
<string name="nextCard">Следующая</string>
|
||||
<string name="previousCard">Предыдущая</string>
|
||||
</resources>
|
||||
@@ -245,4 +245,6 @@
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> kart (<xliff:g id="archivedCount">%2$d</xliff:g> tane arşivlendi)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> kart (<xliff:g id="archivedCount">%2$d</xliff:g> tane arşivlendi)</item>
|
||||
</plurals>
|
||||
<string name="previousCard">Önceki</string>
|
||||
<string name="nextCard">Sonraki</string>
|
||||
</resources>
|
||||
@@ -215,4 +215,30 @@
|
||||
<string name="exportPassword">设置密码来保护导出的内容(可选)</string>
|
||||
<string name="settings_magenta_theme">紫红</string>
|
||||
<string name="settings_violet_theme">紫色</string>
|
||||
<string name="action_show_details">显示详情</string>
|
||||
<string name="action_hide_details">隐藏详情</string>
|
||||
<string name="set_scale">设置大小</string>
|
||||
<string name="app_contributors">因他们而存在: <xliff:g id="app_contributors">%s</xliff:g></string>
|
||||
<string name="and_data_usage">和数据使用方法</string>
|
||||
<string name="failedLaunchingPhotoPicker">找不到支持的图库应用</string>
|
||||
<string name="previousCard">前一张</string>
|
||||
<string name="nextCard">下一张</string>
|
||||
<string name="settings_card_orientation">条形码朝向</string>
|
||||
<string name="settings_landscape_orientation">横向</string>
|
||||
<string name="settings_follow_system_orientation">跟随系统</string>
|
||||
<string name="settings_lock_on_opening_orientation">使用上次打开卡片时的朝向</string>
|
||||
<string name="settings_portrait_orientation">竖向</string>
|
||||
<plurals name="groupCardCountWithArchived">
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> 张卡 (<xliff:g id="archivedCount">%2$d</xliff:g> 张已归档)</item>
|
||||
</plurals>
|
||||
<string name="license">许可证</string>
|
||||
<string name="credits">鸣谢</string>
|
||||
<string name="starred">已收藏</string>
|
||||
<string name="duplicateCard">创建副本</string>
|
||||
<string name="archive">归档</string>
|
||||
<string name="unarchive">移出归档</string>
|
||||
<string name="archived">卡片已归档</string>
|
||||
<string name="unarchived">卡片未归档</string>
|
||||
<string name="archiveList">已归档卡</string>
|
||||
<string name="noUnarchivedCardsMessage">没有未归档卡</string>
|
||||
</resources>
|
||||
@@ -290,4 +290,6 @@
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> card (<xliff:g id="archivedCount">%2$d</xliff:g> archived)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> cards (<xliff:g id="archivedCount">%2$d</xliff:g> archived)</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
<string name="previousCard">Previous</string>
|
||||
<string name="nextCard">Next</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.bottomappbar.BottomAppBar;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.textfield.MaterialAutoCompleteTextView;
|
||||
@@ -381,7 +382,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
Currency currency = Currency.getInstance("EUR");
|
||||
Date expiryDate = new Date();
|
||||
Bitmap frontBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.circle);
|
||||
Bitmap backBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.save_24dp);
|
||||
Bitmap backBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_done);
|
||||
|
||||
storeField.setText("correct store");
|
||||
noteField.setText("correct note");
|
||||
@@ -1194,9 +1195,8 @@ public class LoyaltyCardViewActivityTest {
|
||||
|
||||
assertEquals(false, activity.isFinishing());
|
||||
|
||||
ImageView mainImage = activity.findViewById(R.id.mainImage);
|
||||
View collapsingToolbarLayout = activity.findViewById(R.id.collapsingToolbarLayout);
|
||||
View bottomSheet = activity.findViewById(R.id.bottom_sheet);
|
||||
BottomAppBar bottomAppBar = activity.findViewById(R.id.bottom_app_bar);
|
||||
ImageButton maximizeButton = activity.findViewById(R.id.maximizeButton);
|
||||
ImageButton minimizeButton = activity.findViewById(R.id.minimizeButton);
|
||||
LinearLayout dotIndicator = activity.findViewById(R.id.dotIndicator);
|
||||
@@ -1210,7 +1210,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
|
||||
// Elements should be visible (except minimize button and scaler)
|
||||
assertEquals(View.VISIBLE, collapsingToolbarLayout.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomSheet.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomAppBar.getVisibility());
|
||||
assertEquals(View.VISIBLE, maximizeButton.getVisibility());
|
||||
assertEquals(View.GONE, minimizeButton.getVisibility());
|
||||
assertEquals(View.VISIBLE, editButton.getVisibility());
|
||||
@@ -1228,7 +1228,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
|
||||
// Elements should not be visible (except minimize button and scaler)
|
||||
assertEquals(View.GONE, collapsingToolbarLayout.getVisibility());
|
||||
assertEquals(View.GONE, bottomSheet.getVisibility());
|
||||
assertEquals(View.GONE, bottomAppBar.getVisibility());
|
||||
assertEquals(View.GONE, maximizeButton.getVisibility());
|
||||
assertEquals(View.VISIBLE, minimizeButton.getVisibility());
|
||||
assertEquals(View.GONE, editButton.getVisibility());
|
||||
@@ -1242,7 +1242,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
assertNotEquals(uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY, uiOptions);
|
||||
assertNotEquals(uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN, uiOptions);
|
||||
assertEquals(View.VISIBLE, collapsingToolbarLayout.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomSheet.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomAppBar.getVisibility());
|
||||
assertEquals(View.VISIBLE, maximizeButton.getVisibility());
|
||||
assertEquals(View.GONE, minimizeButton.getVisibility());
|
||||
assertEquals(View.VISIBLE, editButton.getVisibility());
|
||||
@@ -1256,7 +1256,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
assertEquals(uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY, uiOptions);
|
||||
assertEquals(uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN, uiOptions);
|
||||
assertEquals(View.GONE, collapsingToolbarLayout.getVisibility());
|
||||
assertEquals(View.GONE, bottomSheet.getVisibility());
|
||||
assertEquals(View.GONE, bottomAppBar.getVisibility());
|
||||
assertEquals(View.GONE, maximizeButton.getVisibility());
|
||||
assertEquals(View.VISIBLE, minimizeButton.getVisibility());
|
||||
assertEquals(View.GONE, editButton.getVisibility());
|
||||
@@ -1270,7 +1270,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
assertNotEquals(uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY, uiOptions);
|
||||
assertNotEquals(uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN, uiOptions);
|
||||
assertEquals(View.VISIBLE, collapsingToolbarLayout.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomSheet.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomAppBar.getVisibility());
|
||||
assertEquals(View.VISIBLE, maximizeButton.getVisibility());
|
||||
assertEquals(View.GONE, minimizeButton.getVisibility());
|
||||
assertEquals(View.VISIBLE, editButton.getVisibility());
|
||||
@@ -1299,9 +1299,8 @@ public class LoyaltyCardViewActivityTest {
|
||||
|
||||
assertEquals(false, activity.isFinishing());
|
||||
|
||||
ImageView barcodeImage = activity.findViewById(R.id.barcode);
|
||||
View collapsingToolbarLayout = activity.findViewById(R.id.collapsingToolbarLayout);
|
||||
View bottomSheet = activity.findViewById(R.id.bottom_sheet);
|
||||
BottomAppBar bottomAppBar = activity.findViewById(R.id.bottom_app_bar);
|
||||
ImageButton maximizeButton = activity.findViewById(R.id.maximizeButton);
|
||||
ImageButton minimizeButton = activity.findViewById(R.id.minimizeButton);
|
||||
FloatingActionButton editButton = activity.findViewById(R.id.fabEdit);
|
||||
@@ -1314,7 +1313,7 @@ public class LoyaltyCardViewActivityTest {
|
||||
|
||||
// Elements should be visible (except minimize/maximize buttons and barcode and scaler)
|
||||
assertEquals(View.VISIBLE, collapsingToolbarLayout.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomSheet.getVisibility());
|
||||
assertEquals(View.VISIBLE, bottomAppBar.getVisibility());
|
||||
assertEquals(View.GONE, maximizeButton.getVisibility());
|
||||
assertEquals(View.GONE, minimizeButton.getVisibility());
|
||||
assertEquals(View.VISIBLE, editButton.getVisibility());
|
||||
|
||||
3
fastlane/metadata/android/bg/changelogs/113.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
- Добавяне на битон за предишна и следваща карта
|
||||
- Поправяне на цвета на текста на бутона за редактиране
|
||||
- Заменяне на пиктограмата с флопи диск с отметка
|
||||
1
fastlane/metadata/android/cs-CZ/changelogs/112.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Umožnit nastavit vlastní záhlaví více viditelnější
|
||||
3
fastlane/metadata/android/cs-CZ/changelogs/113.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
- Do zobrazení věrnostních karet přidána tlačítka Předchozí a Následující
|
||||
- Oprava barvy popředí na tlačítku Upravit
|
||||
- Nahrazena ikona uložení z diskety na značku zaškrtnutí
|
||||
3
fastlane/metadata/android/en-US/changelogs/113.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
- Add previous and next buttons to the loyalty card view
|
||||
- Fix foreground colour on edit button
|
||||
- Replace floppy disk save icon with checkmark
|
||||
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 59 KiB |
1
fastlane/metadata/android/it-IT/changelogs/106.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Sistemate alcune sequenze di caratteri che vengono mostrate come singolo carattere
|
||||
1
fastlane/metadata/android/it-IT/changelogs/107.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Sistemata l'importazione da Stocard
|
||||
5
fastlane/metadata/android/it-IT/changelogs/108.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
- Aggiunta la possibilità di duplicare una carta
|
||||
- Vietata la scelta di anni prima del 1970 come anno di scadenza della carta (non avrebbe comunque funzionato)
|
||||
- Aggiunta l'archiviazione delle carte
|
||||
- Mosso Elimina da Modifica a Visualizza
|
||||
- Rimossa l'icona del blocco della rotazione schermo a favore di una nuova impostazione di blocco della rotazione
|
||||
1
fastlane/metadata/android/it-IT/changelogs/109.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Sistemato il colore incorretto del testo sul bottone "Non c'è un codice a barre"
|
||||
1
fastlane/metadata/android/it-IT/changelogs/112.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Inserita la possibilità di rendere un'intestazione personalizzata più visibile
|
||||
3
fastlane/metadata/android/it-IT/changelogs/113.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
- Aggiunti bottoni "Precedente" e "Successivo" nella visualizzazione delle carte
|
||||
- Sistemato colore di sottofondo sul bottone di modifica
|
||||
- Sostituita icona del floppy disk per salvare con un segno di spunta
|
||||
1
fastlane/metadata/android/it-IT/changelogs/99.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Ridisegno seguendo Material You
|
||||
2
fastlane/metadata/android/pl-PL/changelogs/102.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Różne mniejsze poprawki
|
||||
- Naprawiono awarię aplikacji podczas używania języka norweskiego
|
||||