mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-16 13:27:28 -04:00
Support for creating a card from shared text
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased - 136
|
||||
|
||||
- Support for creating a card when sharing plain text
|
||||
|
||||
## v2.29.1 - 135 (2024-05-19)
|
||||
|
||||
- Various fixes and improvements to balance handling
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="application/pdf" />
|
||||
</intent-filter>
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.google.android.material.tabs.TabLayout;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -482,7 +483,9 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
if (Intent.ACTION_SEND.equals(receivedAction)) {
|
||||
List<BarcodeValues> barcodeValuesList;
|
||||
|
||||
if (receivedType.startsWith("image/")) {
|
||||
if (receivedType.equals("text/plain")) {
|
||||
barcodeValuesList = Collections.singletonList(new BarcodeValues(null, intent.getStringExtra(Intent.EXTRA_TEXT)));
|
||||
} else if (receivedType.startsWith("image/")) {
|
||||
barcodeValuesList = Utils.retrieveBarcodesFromImage(this, intent.getParcelableExtra(Intent.EXTRA_STREAM));
|
||||
} else if (receivedType.equals("application/pdf")) {
|
||||
barcodeValuesList = Utils.retrieveBarcodesFromPdf(this, intent.getParcelableExtra(Intent.EXTRA_STREAM));
|
||||
|
||||
Reference in New Issue
Block a user