mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-01-05 21:48:01 -05:00
Compare commits
25 Commits
fix/weblat
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9228320b47 | ||
|
|
e217e99864 | ||
|
|
9674af3bae | ||
|
|
a2b85dd37a | ||
|
|
220fe96268 | ||
|
|
917b6cfb7d | ||
|
|
0b687e1788 | ||
|
|
b35fa810ef | ||
|
|
0d1e10d064 | ||
|
|
96359e5942 | ||
|
|
bf63390f65 | ||
|
|
6f54981333 | ||
|
|
aed145239b | ||
|
|
99a8c917b9 | ||
|
|
ef39f30fd7 | ||
|
|
24e996e1a9 | ||
|
|
4178dce4e2 | ||
|
|
514eaae616 | ||
|
|
5692251668 | ||
|
|
6208dd3fd9 | ||
|
|
85288a3658 | ||
|
|
bae7e676b4 | ||
|
|
6ae7491a18 | ||
|
|
e5de694711 | ||
|
|
996cd2cd2c |
@@ -2,7 +2,7 @@
|
||||
|
||||
## Unreleased - 150
|
||||
|
||||
- Made it harder to accidentally close edit view
|
||||
- Prevent the keyboard from overlapping the save button in edit and group screens
|
||||
|
||||
## v2.35.1 - 149 (2025-06-17)
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ dependencies {
|
||||
implementation("com.journeyapps:zxing-android-embedded:4.3.0@aar")
|
||||
implementation("com.github.yalantis:ucrop:2.2.10")
|
||||
implementation("com.google.zxing:core:3.5.3")
|
||||
implementation("org.apache.commons:commons-csv:1.9.0")
|
||||
implementation("org.apache.commons:commons-csv:1.14.1")
|
||||
implementation("com.jaredrummler:colorpicker:1.1.0")
|
||||
implementation("net.lingala.zip4j:zip4j:2.11.5")
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@
|
||||
<activity
|
||||
android:name=".ManageGroupActivity"
|
||||
android:label="@string/group_edit"
|
||||
android:theme="@style/AppTheme.NoActionBar"/>
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity
|
||||
android:name=".LoyaltyCardViewActivity"
|
||||
android:exported="true"
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import protect.card_locker.databinding.BarcodeSelectorActivityBinding;
|
||||
|
||||
/**
|
||||
* This activity is callable and will allow a user to enter
|
||||
* barcode data and generate all barcodes possible for
|
||||
* the data. The user may then select any barcode, where its
|
||||
* data and type will be returned to the caller.
|
||||
*/
|
||||
public class BarcodeSelectorActivity extends CatimaAppCompatActivity implements BarcodeSelectorAdapter.BarcodeSelectorListener {
|
||||
private BarcodeSelectorActivityBinding binding;
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
// Result this activity will return
|
||||
public static final String BARCODE_CONTENTS = "contents";
|
||||
public static final String BARCODE_FORMAT = "format";
|
||||
|
||||
private final Handler typingDelayHandler = new Handler(Looper.getMainLooper());
|
||||
public static final Integer INPUT_DELAY = 250;
|
||||
|
||||
private BarcodeSelectorAdapter mAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = BarcodeSelectorActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.selectBarcodeTitle);
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
EditText cardId = binding.cardId;
|
||||
ListView mBarcodeList = binding.barcodes;
|
||||
mAdapter = new BarcodeSelectorAdapter(this, new ArrayList<>(), this);
|
||||
mBarcodeList.setAdapter(mAdapter);
|
||||
|
||||
cardId.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Delay the input processing so we avoid overload
|
||||
typingDelayHandler.removeCallbacksAndMessages(null);
|
||||
|
||||
typingDelayHandler.postDelayed(() -> {
|
||||
Log.d(TAG, "Entered text: " + s);
|
||||
|
||||
runOnUiThread(() -> {
|
||||
generateBarcodes(s.toString());
|
||||
});
|
||||
}, INPUT_DELAY);
|
||||
}
|
||||
});
|
||||
|
||||
final Bundle b = getIntent().getExtras();
|
||||
final String initialCardId = b != null ? b.getString(LoyaltyCard.BUNDLE_LOYALTY_CARD_CARD_ID) : null;
|
||||
|
||||
if (initialCardId != null) {
|
||||
cardId.setText(initialCardId);
|
||||
} else {
|
||||
generateBarcodes("");
|
||||
}
|
||||
}
|
||||
|
||||
private void generateBarcodes(String value) {
|
||||
// Update barcodes
|
||||
ArrayList<CatimaBarcodeWithValue> barcodes = new ArrayList<>();
|
||||
for (BarcodeFormat barcodeFormat : CatimaBarcode.barcodeFormats) {
|
||||
CatimaBarcode catimaBarcode = CatimaBarcode.fromBarcode(barcodeFormat);
|
||||
barcodes.add(new CatimaBarcodeWithValue(catimaBarcode, value));
|
||||
}
|
||||
mAdapter.setBarcodes(barcodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
setResult(Activity.RESULT_CANCELED);
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowClicked(int inputPosition, View view) {
|
||||
CatimaBarcodeWithValue barcodeWithValue = mAdapter.getItem(inputPosition);
|
||||
CatimaBarcode catimaBarcode = barcodeWithValue.catimaBarcode();
|
||||
|
||||
if (!mAdapter.isValid(view)) {
|
||||
Toast.makeText(this, getString(R.string.wrongValueForBarcodeType), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String barcodeFormat = catimaBarcode.format().name();
|
||||
String value = barcodeWithValue.value();
|
||||
|
||||
Log.d(TAG, "Selected barcode type " + barcodeFormat);
|
||||
|
||||
Intent result = new Intent();
|
||||
result.putExtra(BARCODE_FORMAT, barcodeFormat);
|
||||
result.putExtra(BARCODE_CONTENTS, value);
|
||||
BarcodeSelectorActivity.this.setResult(RESULT_OK, result);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
118
app/src/main/java/protect/card_locker/BarcodeSelectorActivity.kt
Normal file
118
app/src/main/java/protect/card_locker/BarcodeSelectorActivity.kt
Normal file
@@ -0,0 +1,118 @@
|
||||
package protect.card_locker
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.MenuProvider
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import protect.card_locker.BarcodeSelectorAdapter.BarcodeSelectorListener
|
||||
import protect.card_locker.databinding.BarcodeSelectorActivityBinding
|
||||
|
||||
/**
|
||||
* This activity is callable and will allow a user to enter
|
||||
* barcode data and generate all barcodes possible for
|
||||
* the data. The user may then select any barcode, where its
|
||||
* data and type will be returned to the caller.
|
||||
*/
|
||||
class BarcodeSelectorActivity : CatimaAppCompatActivity(), BarcodeSelectorListener, MenuProvider {
|
||||
|
||||
private lateinit var binding: BarcodeSelectorActivityBinding
|
||||
private lateinit var mAdapter: BarcodeSelectorAdapter
|
||||
|
||||
companion object {
|
||||
private const val TAG = "Catima"
|
||||
|
||||
// Result this activity will return
|
||||
const val BARCODE_CONTENTS = "contents"
|
||||
const val BARCODE_FORMAT = "format"
|
||||
|
||||
const val INPUT_DELAY = 250L
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
addMenuProvider(this)
|
||||
binding = BarcodeSelectorActivityBinding.inflate(layoutInflater)
|
||||
setTitle(R.string.selectBarcodeTitle)
|
||||
setContentView(binding.getRoot())
|
||||
Utils.applyWindowInsets(binding.getRoot())
|
||||
setSupportActionBar(binding.toolbar)
|
||||
enableToolbarBackButton()
|
||||
|
||||
var typingDelayJob: Job? = null
|
||||
val cardId = binding.cardId
|
||||
val mBarcodeList = binding.barcodes
|
||||
mAdapter = BarcodeSelectorAdapter(this, ArrayList<CatimaBarcodeWithValue?>(), this)
|
||||
mBarcodeList.adapter = mAdapter
|
||||
|
||||
cardId.doOnTextChanged { s, _, _, _ ->
|
||||
typingDelayJob?.cancel()
|
||||
typingDelayJob =
|
||||
lifecycleScope.launch {
|
||||
delay(INPUT_DELAY) // Delay the input processing so we avoid overload
|
||||
Log.d(TAG, "Entered text: $s")
|
||||
generateBarcodes(s.toString())
|
||||
}
|
||||
}
|
||||
|
||||
val initialCardId = intent.extras?.getString(LoyaltyCard.BUNDLE_LOYALTY_CARD_CARD_ID)
|
||||
|
||||
initialCardId?.let {
|
||||
cardId.setText(initialCardId)
|
||||
} ?: generateBarcodes("")
|
||||
|
||||
}
|
||||
|
||||
private fun generateBarcodes(value: String?) {
|
||||
// Update barcodes
|
||||
val barcodes = ArrayList<CatimaBarcodeWithValue?>()
|
||||
CatimaBarcode.barcodeFormats.forEach {
|
||||
val catimaBarcode = CatimaBarcode.fromBarcode(it)
|
||||
barcodes.add(CatimaBarcodeWithValue(catimaBarcode, value))
|
||||
}
|
||||
mAdapter.setBarcodes(barcodes)
|
||||
}
|
||||
|
||||
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {}
|
||||
|
||||
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
|
||||
if (menuItem.itemId == android.R.id.home) {
|
||||
setResult(RESULT_CANCELED)
|
||||
finish()
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onRowClicked(inputPosition: Int, view: View) {
|
||||
val barcodeWithValue = mAdapter.getItem(inputPosition)
|
||||
val catimaBarcode = barcodeWithValue!!.catimaBarcode()
|
||||
|
||||
if (!mAdapter.isValid(view)) {
|
||||
Toast.makeText(this, getString(R.string.wrongValueForBarcodeType), Toast.LENGTH_LONG).show()
|
||||
return
|
||||
}
|
||||
|
||||
val barcodeFormat = catimaBarcode.format().name
|
||||
val value = barcodeWithValue.value()
|
||||
|
||||
Log.d(TAG, "Selected barcode type $barcodeFormat")
|
||||
|
||||
Intent().apply {
|
||||
putExtra(BARCODE_FORMAT, barcodeFormat)
|
||||
putExtra(BARCODE_CONTENTS, value)
|
||||
setResult(RESULT_OK, this)
|
||||
}
|
||||
finish()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.pm.ShortcutInfoCompat;
|
||||
import androidx.core.content.pm.ShortcutManagerCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import protect.card_locker.databinding.CardShortcutConfigureActivityBinding;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
/**
|
||||
* The configuration screen for creating a shortcut.
|
||||
*/
|
||||
public class CardShortcutConfigure extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener {
|
||||
private CardShortcutConfigureActivityBinding binding;
|
||||
static final String TAG = "Catima";
|
||||
private SQLiteDatabase mDatabase;
|
||||
private LoyaltyCardCursorAdapter mAdapter;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
binding = CardShortcutConfigureActivityBinding.inflate(getLayoutInflater());
|
||||
mDatabase = new DBHelper(this).getReadableDatabase();
|
||||
|
||||
// Set the result to CANCELED. This will cause nothing to happen if the
|
||||
// aback button is pressed.
|
||||
setResult(RESULT_CANCELED);
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
toolbar.setTitle(R.string.shortcutSelectCard);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
// If there are no cards, bail
|
||||
int cardCount = DBHelper.getLoyaltyCardCount(mDatabase);
|
||||
if (cardCount == 0) {
|
||||
Toast.makeText(this, R.string.noCardsMessage, Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
Cursor cardCursor = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.All);
|
||||
mAdapter = new LoyaltyCardCursorAdapter(this, cardCursor, this, null);
|
||||
binding.list.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
var layoutManager = (GridLayoutManager) binding.list.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
var settings = new Settings(this);
|
||||
layoutManager.setSpanCount(settings.getPreferredColumnCount());
|
||||
}
|
||||
}
|
||||
|
||||
private void onClickAction(int position) {
|
||||
Cursor selected = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.All);
|
||||
selected.moveToPosition(position);
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(CardShortcutConfigure.this, selected);
|
||||
|
||||
Log.d(TAG, "Creating shortcut for card " + loyaltyCard.store + "," + loyaltyCard.id);
|
||||
|
||||
ShortcutInfoCompat shortcut = ShortcutHelper.createShortcutBuilder(CardShortcutConfigure.this, loyaltyCard).build();
|
||||
|
||||
setResult(RESULT_OK, ShortcutManagerCompat.createShortcutResultIntent(CardShortcutConfigure.this, shortcut));
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu inputMenu) {
|
||||
getMenuInflater().inflate(R.menu.card_details_menu, inputMenu);
|
||||
|
||||
return super.onCreateOptionsMenu(inputMenu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem inputItem) {
|
||||
int id = inputItem.getItemId();
|
||||
|
||||
if (id == R.id.action_display_options) {
|
||||
mAdapter.showDisplayOptionsDialog();
|
||||
invalidateOptionsMenu();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(inputItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowClicked(int inputPosition) {
|
||||
onClickAction(inputPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowLongClicked(int inputPosition) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package protect.card_locker
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.pm.ShortcutManagerCompat
|
||||
import androidx.core.view.MenuProvider
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import protect.card_locker.LoyaltyCardCursorAdapter.CardAdapterListener
|
||||
import protect.card_locker.databinding.CardShortcutConfigureActivityBinding
|
||||
import protect.card_locker.preferences.Settings
|
||||
|
||||
class CardShortcutConfigure : CatimaAppCompatActivity(), CardAdapterListener, MenuProvider {
|
||||
|
||||
private lateinit var binding: CardShortcutConfigureActivityBinding
|
||||
private lateinit var mDatabase: SQLiteDatabase
|
||||
private lateinit var mAdapter: LoyaltyCardCursorAdapter
|
||||
|
||||
private companion object {
|
||||
private const val TAG: String = "Catima"
|
||||
}
|
||||
|
||||
public override fun onCreate(savedInstanceBundle: Bundle?) {
|
||||
super.onCreate(savedInstanceBundle)
|
||||
addMenuProvider(this)
|
||||
binding = CardShortcutConfigureActivityBinding.inflate(layoutInflater)
|
||||
mDatabase = DBHelper(this).readableDatabase
|
||||
|
||||
// Set the result to CANCELED.
|
||||
// This will cause nothing to happen if the back button is pressed.
|
||||
setResult(RESULT_CANCELED)
|
||||
|
||||
setContentView(binding.getRoot())
|
||||
Utils.applyWindowInsets(binding.getRoot())
|
||||
|
||||
binding.toolbar.apply {
|
||||
setTitle(R.string.shortcutSelectCard)
|
||||
setSupportActionBar(this)
|
||||
}
|
||||
|
||||
// If there are no cards, bail
|
||||
if (DBHelper.getLoyaltyCardCount(mDatabase) == 0) {
|
||||
Toast.makeText(this, R.string.noCardsMessage, Toast.LENGTH_LONG).show()
|
||||
finish()
|
||||
}
|
||||
|
||||
val cardCursor = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.All)
|
||||
mAdapter = LoyaltyCardCursorAdapter(this, cardCursor, this, null)
|
||||
binding.list.setAdapter(mAdapter)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
val layoutManager = binding.list.layoutManager as GridLayoutManager?
|
||||
layoutManager?.setSpanCount(Settings(this).getPreferredColumnCount())
|
||||
}
|
||||
|
||||
private fun onClickAction(position: Int) {
|
||||
val selected = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.All)
|
||||
selected.moveToPosition(position)
|
||||
val loyaltyCard = LoyaltyCard.fromCursor(this, selected)
|
||||
|
||||
Log.d(TAG, "Creating shortcut for card ${loyaltyCard.store}, ${loyaltyCard.id}")
|
||||
|
||||
val shortcut = ShortcutHelper.createShortcutBuilder(this, loyaltyCard).build()
|
||||
|
||||
setResult(RESULT_OK,
|
||||
ShortcutManagerCompat.createShortcutResultIntent(this, shortcut))
|
||||
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onCreateMenu(inputMenu: Menu, menuInflater: MenuInflater) {
|
||||
menuInflater.inflate(R.menu.card_details_menu, inputMenu)
|
||||
}
|
||||
|
||||
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
|
||||
if (menuItem.itemId == R.id.action_display_options) {
|
||||
mAdapter.showDisplayOptionsDialog()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onRowClicked(inputPosition: Int) {
|
||||
onClickAction(inputPosition)
|
||||
}
|
||||
|
||||
override fun onRowLongClicked(inputPosition: Int) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
@@ -45,6 +44,9 @@ import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
@@ -298,7 +300,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity implements
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = LoyaltyCardEditActivityBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Utils.applyWindowInsetsAndFabOffset(binding.getRoot(), binding.fabSave);
|
||||
|
||||
viewModel = new ViewModelProvider(this).get(LoyaltyCardEditActivityViewModel.class);
|
||||
|
||||
@@ -681,15 +683,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity implements
|
||||
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
|
||||
@Override
|
||||
public void handleOnBackPressed() {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
View view = getCurrentFocus();
|
||||
if (view != null && imm.isAcceptingText()) {
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
view.clearFocus();
|
||||
}
|
||||
else {
|
||||
askBeforeQuitIfChanged();
|
||||
}
|
||||
askBeforeQuitIfChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1523,7 +1517,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity implements
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
getOnBackPressedDispatcher().onBackPressed();
|
||||
askBeforeQuitIfChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
super.onCreate(inputSavedInstanceState);
|
||||
binding = ActivityManageGroupBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Utils.applyWindowInsetsAndFabOffset(binding.getRoot(), binding.fabSave);
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ import androidx.palette.graphics.Palette;
|
||||
|
||||
import com.google.android.material.color.DynamicColors;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
import com.google.zxing.LuminanceSource;
|
||||
import com.google.zxing.MultiFormatReader;
|
||||
@@ -1139,6 +1140,27 @@ public class Utils {
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
}
|
||||
|
||||
public static void applyWindowInsetsAndFabOffset(View root, FloatingActionButton fab) {
|
||||
/* This function is a copy of applyWindowInsets, with the added behaviour that it ensures the FAB will be displayed vertically above the keyboard at all times */
|
||||
ViewCompat.setOnApplyWindowInsetsListener(root, (view, windowInsets) -> {
|
||||
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
|
||||
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
layoutParams.leftMargin = insets.left;
|
||||
layoutParams.bottomMargin = insets.bottom;
|
||||
layoutParams.rightMargin = insets.right;
|
||||
layoutParams.topMargin = insets.top;
|
||||
view.setLayoutParams(layoutParams);
|
||||
|
||||
// This is required to move the FAB above the keyboard when keyboard is open
|
||||
Insets imeInsets = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
|
||||
boolean isKeyboardVisible = windowInsets.isVisible(WindowInsetsCompat.Type.ime());
|
||||
fab.setTranslationY(isKeyboardVisible ? (- imeInsets.bottom) : 0);
|
||||
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
}
|
||||
|
||||
public static ImageView.ScaleType getRecommendedScaleTypeForThumbnailImage(@Nullable Bitmap image) {
|
||||
// Return something sensible if no image
|
||||
|
||||
@@ -296,4 +296,10 @@
|
||||
<string name="settings_column_count_5">5</string>
|
||||
<string name="settings_column_count_6">6</string>
|
||||
<string name="settings_column_count_7">7</string>
|
||||
<string name="sort_by_valid_from">Có hiệu lực từ</string>
|
||||
<string name="addFromPkpass">Chọn tệp Passbook (.pkpass)</string>
|
||||
<string name="unsupportedFile">Tập tin này không được hỗ trợ</string>
|
||||
<string name="generic_error_please_retry">Xin lỗi, có gì đó không ổn, vui lòng thử lại...</string>
|
||||
<string name="width">Chiều rộng</string>
|
||||
<string name="setBarcodeWidth">Đặt chiều rộng mã vạch</string>
|
||||
</resources>
|
||||
|
||||
1
fastlane/metadata/android/cs-CZ/changelogs/150.txt
Normal file
1
fastlane/metadata/android/cs-CZ/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Zabránění překrytí tlačítka uložení klávesnicí na stránkách úpravy a skupin
|
||||
1
fastlane/metadata/android/de-DE/changelogs/150.txt
Normal file
1
fastlane/metadata/android/de-DE/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Beugt dem Verdecken der „Speichern“-Taste durch die Tastatur in der Bearbeitungs- bzw. Gruppenansicht vor
|
||||
@@ -1 +1 @@
|
||||
- Made it harder to accidentally close edit view
|
||||
- Prevent the keyboard from overlapping the save button in edit and group screens
|
||||
1
fastlane/metadata/android/fr-FR/changelogs/150.txt
Normal file
1
fastlane/metadata/android/fr-FR/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Empêche le clavier de passer au-dessus du bouton de sauvegarde dans les écrans de modifications et de regroupements
|
||||
1
fastlane/metadata/android/lt/changelogs/150.txt
Normal file
1
fastlane/metadata/android/lt/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Neleisti klaviatūrai uždengti išsaugojimo mygtuko, redagavimo ir grupių ekranuose
|
||||
5
fastlane/metadata/android/lt/changelogs/16.txt
Normal file
5
fastlane/metadata/android/lt/changelogs/16.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
- Pridėta galimybė pridėti sparčiuosius klavišus į pagrindinį ekraną kuriant arba redaguojant kortelę. (pull #155 (https://github.com/brarcher/loyalty-card-locker/pull/155))
|
||||
- Valdiklis pašalintas, nes buvo prastas sparčiųjų klavišų pakaitalas. (pull #155 (https://github.com/brarcher/loyalty-card-locker/pull/155))
|
||||
- Ištaisyta atsarginių kopijų eksportavimo klaida (Android 7+). pull #153 (https://github.com/brarcher/loyalty-card-locker/pull/153))
|
||||
- Eksportuojant atsargines kopijas pateikiamas tikslesnis MIME tipas. (pull #156 (https://github.com/brarcher/loyalty-card-locker/pull/156))
|
||||
- Pataisyta klaida, dėl kurios nebuvo galima redaguoti kortelės. (pull #155 (https://github.com/brarcher/loyalty-card-locker/pull/155))
|
||||
2
fastlane/metadata/android/lt/changelogs/17.txt
Normal file
2
fastlane/metadata/android/lt/changelogs/17.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Pridėta galimybė pridėti kortelių sparčiąsias nuorodas tiesiai iš paleidiklio arba pagrindinio ekrano. (pull #161 (https://github.com/brarcher/loyalty-card-locker/pull/161))
|
||||
- Pašalinta lojalumo kortelių sparčiųjų nuorodų kūrimo galimybė tiesiogiai programoje. Dėl to nebereikia leidimo sparčiųjų nuorodų kūrimui. (pull #163 (https://github.com/brarcher/loyalty-card-locker/pull/163))
|
||||
2
fastlane/metadata/android/lt/changelogs/18.txt
Normal file
2
fastlane/metadata/android/lt/changelogs/18.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Ištaisyta klaida „Android SDK 24+“ versijose, dėl kurios naudojant failų pasirinkimo importavimo funkciją programėlė sugestų. (pull #170 (https://github.com/brarcher/loyalty-card-locker/pull/170))
|
||||
- Naujas piktograma ir spalvų schema. (pull #171 (https://github.com/brarcher/loyalty-card-locker/pull/171))
|
||||
3
fastlane/metadata/android/lt/changelogs/19.txt
Normal file
3
fastlane/metadata/android/lt/changelogs/19.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
- Pataisytas gedimas importuojant kai kuriuos sugadintus CSV failus. (pull #177 (https://github.com/brarcher/loyalty-card-locker/pull/177))
|
||||
- Pataisytas atsarginių kopijų importavimas iš failų sistemos. (pull #180 (https://github.com/brarcher/loyalty-card-locker/pull/180))
|
||||
- Pataisyta problema importuojant atsargines kopijas iš kai kurių turinio tiekėjų. (pull #179 (https://github.com/brarcher/loyalty-card-locker/pull/179))
|
||||
3
fastlane/metadata/android/lt/changelogs/2.txt
Normal file
3
fastlane/metadata/android/lt/changelogs/2.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
- Italų kalbos vertimai.
|
||||
- Palaikymas visiems 1D brūkšninių kodų tipams. (anksčiau palaikomi tik produktų 1D brūkšniniai kodai)
|
||||
- Pridėtas būtinas kameros leidimas, kuris iš pradžių trūko.
|
||||
1
fastlane/metadata/android/lv/changelogs/150.txt
Normal file
1
fastlane/metadata/android/lv/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Labošanas un kopu skatos novērsta saglabāšanas pogas aizklāšana ar tastatūru
|
||||
1
fastlane/metadata/android/pt-PT/changelogs/150.txt
Normal file
1
fastlane/metadata/android/pt-PT/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Impedir que o teclado sobreponha o botão gravar em ecrãs de edição e grupo
|
||||
1
fastlane/metadata/android/pt/changelogs/150.txt
Normal file
1
fastlane/metadata/android/pt/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Impedir que o teclado sobreponha o botão gravar em ecrãs de edição e grupo
|
||||
1
fastlane/metadata/android/ru-RU/changelogs/150.txt
Normal file
1
fastlane/metadata/android/ru-RU/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Исправлена ошибка перекрытия клавиатурой кнопки сохранения на экранах редактирования и групп
|
||||
1
fastlane/metadata/android/uk/changelogs/150.txt
Normal file
1
fastlane/metadata/android/uk/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Запобігання перекриттю кнопки збереження клавіатурою на екранах редагування та групування
|
||||
1
fastlane/metadata/android/zh-CN/changelogs/150.txt
Normal file
1
fastlane/metadata/android/zh-CN/changelogs/150.txt
Normal file
@@ -0,0 +1 @@
|
||||
- 防止编辑与分组屏幕中键盘和保存按钮相重叠
|
||||
Reference in New Issue
Block a user