From 865795cbe0511f8e5fd9e95a6937224d897fae7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Tue, 20 Aug 2024 15:22:24 +0200 Subject: [PATCH 1/4] Remove `TelEnterActivity` (cherry picked from commit 4a0c21ca5a511675a18581fab1ad3997f951c2b0) --- app/src/main/AndroidManifest.xml | 5 -- .../QrGeneratorOverviewActivity.java | 9 ++- .../generator/TelEnterActivity.java | 57 ------------------- 3 files changed, 8 insertions(+), 63 deletions(-) delete mode 100644 app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 471da6ee..bcfcdb3d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -99,11 +99,6 @@ android:label="E-Mail" android:parentActivityName=".ui.activities.generator.QrGeneratorOverviewActivity" android:windowSoftInputMode="adjustResize" /> - value != 3).mapToObj(value -> finalGenerator[value]).toList().toArray(String[]::new); + icons = IntStream.range(0, finalIcons.length).filter(value -> value != 3).mapToObj(value -> finalIcons[value]).toList().toArray(Integer[]::new); GeneratorListAdapter adapter = new GeneratorListAdapter(this, generator, icons); listView.setAdapter(adapter); listView.setOnItemClickListener((parent, view, position, id) -> { + // Skip position 3 for Google Play version + if (position >= 3) position++; 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); 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 63c8fe8a..00000000 --- a/app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java +++ /dev/null @@ -1,57 +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 { - - @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); - } - - }); - } -} From f67abebf90a06076ac1a8278e2c7e01aca4256a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Mon, 9 Sep 2024 11:37:52 +0200 Subject: [PATCH 2/4] Bump version to 4.6.5 (49) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f9bc55d3..037d6093 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { compileSdk 34 targetSdkVersion 34 multiDexEnabled true - versionCode 48 - versionName "4.6.4" + versionCode 49 + versionName "4.6.5" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' buildFeatures.dataBinding = true vectorDrawables.useSupportLibrary = true From 92a9e13b02dd023047232e05d16d9756d7d24688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Mon, 9 Sep 2024 11:42:21 +0200 Subject: [PATCH 3/4] Revert "Remove `TelEnterActivity`" This reverts commit 865795cbe0511f8e5fd9e95a6937224d897fae7a. --- app/src/main/AndroidManifest.xml | 5 ++ .../QrGeneratorOverviewActivity.java | 9 +-- .../generator/TelEnterActivity.java | 57 +++++++++++++++++++ 3 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bcfcdb3d..471da6ee 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -99,6 +99,11 @@ android:label="E-Mail" android:parentActivityName=".ui.activities.generator.QrGeneratorOverviewActivity" android:windowSoftInputMode="adjustResize" /> + value != 3).mapToObj(value -> finalGenerator[value]).toList().toArray(String[]::new); - icons = IntStream.range(0, finalIcons.length).filter(value -> value != 3).mapToObj(value -> finalIcons[value]).toList().toArray(Integer[]::new); GeneratorListAdapter adapter = new GeneratorListAdapter(this, generator, icons); listView.setAdapter(adapter); listView.setOnItemClickListener((parent, view, position, id) -> { - // Skip position 3 for Google Play version - if (position >= 3) position++; 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); 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 new file mode 100644 index 00000000..63c8fe8a --- /dev/null +++ b/app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/activities/generator/TelEnterActivity.java @@ -0,0 +1,57 @@ +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 { + + @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); + } + + }); + } +} From 859f11f73c8b40d96f457a56043f9ad5cf21cfb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Mon, 9 Sep 2024 11:43:28 +0200 Subject: [PATCH 4/4] Bump version to 4.6.6 (50) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 037d6093..392c9f33 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { compileSdk 34 targetSdkVersion 34 multiDexEnabled true - versionCode 49 - versionName "4.6.5" + versionCode 50 + versionName "4.6.6" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' buildFeatures.dataBinding = true vectorDrawables.useSupportLibrary = true