From ce19113108cb706059d6a9447610a35bcda788e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 12 Jan 2024 12:34:43 +0100 Subject: [PATCH 01/12] Bump version to 4.5.2 (33) - Fix issue with Google Play release --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f05b562..b91a053 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { compileSdk 34 targetSdkVersion 34 multiDexEnabled true - versionCode 31 - versionName "4.5.0" + versionCode 33 + versionName "4.5.2" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' buildFeatures.dataBinding = true vectorDrawables.useSupportLibrary = true From 13f5c133f26092e8ae518fae2a6f464912510a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Tue, 16 Jan 2024 15:24:43 +0100 Subject: [PATCH 02/12] Remove MailEnterActivity and TelEnterActivity --- app/src/main/AndroidManifest.xml | 10 -- .../generator/MailEnterActivity.java | 69 --------- .../QrGeneratorOverviewActivity.java | 18 +-- .../generator/TelEnterActivity.java | 97 ------------ .../main/res/layout/activity_mail_enter.xml | 144 ------------------ .../main/res/layout/activity_tel_enter.xml | 68 --------- app/src/main/res/values-da/strings.xml | 2 - app/src/main/res/values-de/strings.xml | 2 - app/src/main/res/values-fr/strings.xml | 2 - app/src/main/res/values-gl/strings.xml | 2 - app/src/main/res/values-it/strings.xml | 2 - app/src/main/res/values-ja/strings.xml | 2 - app/src/main/res/values-nl/strings.xml | 2 - app/src/main/res/values-tr/strings.xml | 2 - app/src/main/res/values-zh/strings.xml | 2 - app/src/main/res/values/strings.xml | 2 - 16 files changed, 8 insertions(+), 418 deletions(-) delete mode 100644 app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/MailEnterActivity.java delete mode 100644 app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java delete mode 100644 app/src/main/res/layout/activity_mail_enter.xml delete mode 100644 app/src/main/res/layout/activity_tel_enter.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index eb9c03d..12f9059 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -93,16 +93,6 @@ android:name=".ui.activities.generator.QrGeneratorDisplayActivity" android:label="URL" android:parentActivityName=".ui.activities.generator.QrGeneratorOverviewActivity" /> - - { Intent intent = switch (position) { case 0 -> new Intent(QrGeneratorOverviewActivity.this, TextEnterActivity.class); - case 1 -> new Intent(QrGeneratorOverviewActivity.this, MailEnterActivity.class); - case 2 -> new Intent(QrGeneratorOverviewActivity.this, UrlEnterActivity.class); - case 3 -> new Intent(QrGeneratorOverviewActivity.this, TelEnterActivity.class); - case 4 -> new Intent(QrGeneratorOverviewActivity.this, SmsEnterActivity.class); - case 5 -> new Intent(QrGeneratorOverviewActivity.this, GeoLocationEnterActivity.class); - case 6 -> new Intent(QrGeneratorOverviewActivity.this, MeCardEnterActivity.class); - case 7 -> new Intent(QrGeneratorOverviewActivity.this, BizCardEnterActivity.class); - case 8 -> new Intent(QrGeneratorOverviewActivity.this, WifiEnterActivity.class); - case 9 -> new Intent(QrGeneratorOverviewActivity.this, VcardEnterActivity.class); - case 10 -> new Intent(QrGeneratorOverviewActivity.this, MarketEnterActivity.class); + case 1 -> new Intent(QrGeneratorOverviewActivity.this, UrlEnterActivity.class); + case 2 -> new Intent(QrGeneratorOverviewActivity.this, SmsEnterActivity.class); + case 3 -> new Intent(QrGeneratorOverviewActivity.this, GeoLocationEnterActivity.class); + case 4 -> new Intent(QrGeneratorOverviewActivity.this, MeCardEnterActivity.class); + case 5 -> new Intent(QrGeneratorOverviewActivity.this, BizCardEnterActivity.class); + case 6 -> new Intent(QrGeneratorOverviewActivity.this, WifiEnterActivity.class); + case 7 -> new Intent(QrGeneratorOverviewActivity.this, VcardEnterActivity.class); + case 8 -> new Intent(QrGeneratorOverviewActivity.this, MarketEnterActivity.class); default -> null; }; startActivity(intent); diff --git a/app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java b/app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java deleted file mode 100644 index bb25cbb..0000000 --- a/app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.secuso.privacyfriendlycodescanner.qrscanner.ui.activities.generator; - -import android.content.Intent; -import android.database.Cursor; -import android.net.Uri; -import android.os.Bundle; -import android.provider.ContactsContract; -import android.text.InputFilter; -import android.view.View; -import android.widget.EditText; -import android.widget.Toast; - -import androidx.appcompat.app.AppCompatActivity; -import androidx.constraintlayout.widget.ConstraintLayout; - -import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton; -import com.secuso.privacyfriendlycodescanner.qrscanner.R; -import com.secuso.privacyfriendlycodescanner.qrscanner.generator.Contents; -import com.secuso.privacyfriendlycodescanner.qrscanner.ui.helpers.GeneratorKeyboardListener; - -public class TelEnterActivity extends AppCompatActivity { - - private static final int REQUEST_SELECT_PHONE = 1; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_tel_enter); - - final EditText qrResult = (EditText) findViewById(R.id.editPhone); - - int maxLength = 75; - qrResult.setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)}); - - ExtendedFloatingActionButton generate = (ExtendedFloatingActionButton) findViewById(R.id.btnGenerate); - - ConstraintLayout rootView = (ConstraintLayout) findViewById(R.id.rootView); - GeneratorKeyboardListener listener = new GeneratorKeyboardListener(rootView, generate, R.id.btnGenerate, getApplicationContext().getResources().getDisplayMetrics().densityDpi); - rootView.getViewTreeObserver().addOnGlobalLayoutListener(listener); - - generate.setOnClickListener(new View.OnClickListener() { - String result; - - @Override - public void onClick(View v) { - result = qrResult.getText().toString(); - if (result.isEmpty()) { - Toast.makeText(TelEnterActivity.this, R.string.activity_enter_toast_missing_data, Toast.LENGTH_SHORT).show(); - return; - } - Intent i = new Intent(TelEnterActivity.this, QrGeneratorDisplayActivity.class); - i.putExtra("gn", result); - i.putExtra("type", Contents.Type.PHONE); - startActivity(i); - } - - }); - - findViewById(R.id.selectContactButton).setOnClickListener(view -> selectPhoneNumber()); - - } - - private void selectPhoneNumber() { - Intent intent = new Intent(Intent.ACTION_PICK); - intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE); - if (intent.resolveActivity(getPackageManager()) != null) { - startActivityForResult(intent, REQUEST_SELECT_PHONE); - } - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - - if (requestCode == REQUEST_SELECT_PHONE && resultCode == RESULT_OK) { - Uri contactUri = data.getData(); - String[] projection = - { - ContactsContract.CommonDataKinds.Phone._ID, - ContactsContract.CommonDataKinds.Phone.NUMBER, - ContactsContract.CommonDataKinds.Phone.TYPE, - ContactsContract.CommonDataKinds.Phone.LABEL - }; - try { - Cursor cursor = getContentResolver().query(contactUri, projection, null, null, null); - if (cursor.moveToFirst()) { - int phoneNoIdx = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); - String phoneNo = cursor.getString(phoneNoIdx); - ((EditText) findViewById(R.id.editPhone)).setText(phoneNo); - } - cursor.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/app/src/main/res/layout/activity_mail_enter.xml b/app/src/main/res/layout/activity_mail_enter.xml deleted file mode 100644 index 8b95bd9..0000000 --- a/app/src/main/res/layout/activity_mail_enter.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_tel_enter.xml b/app/src/main/res/layout/activity_tel_enter.xml deleted file mode 100644 index 0f54e8b..0000000 --- a/app/src/main/res/layout/activity_tel_enter.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - -