Porównaj commity

...

6 Commity

Autor SHA1 Wiadomość Data
Ahmet Inan ee077735c4 v1.45 2022-10-31 12:13:32 +01:00
Ahmet Inan 93a89ebfca add some flag to pending intent when needed 2022-10-31 12:13:32 +01:00
Ahmet Inan fb4e406d7b use updated libs and tools 2022-10-31 12:13:32 +01:00
Ahmet Inan 26ddfc1f49 added exported=true to manifest 2022-10-31 12:13:32 +01:00
Ahmet Inan a32053fb93 moved namespace string 2022-10-31 12:13:32 +01:00
Ahmet Inan 724458f26a replaced menu item switch with a buncha if 2022-10-31 12:13:32 +01:00
5 zmienionych plików z 160 dodań i 122 usunięć

Wyświetl plik

@ -1,14 +1,13 @@
apply plugin: 'com.android.application'
android {
buildToolsVersion "29.0.2"
compileSdkVersion 29
compileSdkVersion 32
defaultConfig {
applicationId "xdsopl.robot36"
minSdkVersion 16
targetSdkVersion 29
versionCode 45
versionName "1.44"
minSdkVersion 21
targetSdkVersion 32
versionCode 46
versionName "1.45"
renderscriptTargetApi 21
renderscriptSupportModeEnabled true
}
@ -18,9 +17,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
namespace 'xdsopl.robot36'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
}

Wyświetl plik

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xdsopl.robot36" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
@ -13,6 +12,7 @@
android:configChanges="keyboardHidden|orientation|screenSize"
android:name="xdsopl.robot36.MainActivity"
android:launchMode="singleTask"
android:exported="true"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Wyświetl plik

@ -73,7 +73,10 @@ public class MainActivity extends AppCompatActivity {
private void showNotification() {
Intent intent = new Intent(this, MainActivity.class);
PendingIntent pending = PendingIntent.getActivity(this, 0, intent, 0);
int flags = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
flags = PendingIntent.FLAG_IMMUTABLE;
PendingIntent pending = PendingIntent.getActivity(this, 0, intent, flags);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = manager.getNotificationChannel(channelID);
if (channel == null) {
@ -343,116 +346,151 @@ public class MainActivity extends AppCompatActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_toggle_decoder:
toggleDecoder();
return true;
case R.id.action_save_image:
storeBitmap(image.bitmap);
return true;
case R.id.action_clear_image:
decoder.clear_image();
return true;
case R.id.action_sharpest_image:
decoder.adjust_blur(-3);
return true;
case R.id.action_sharper_image:
decoder.adjust_blur(-2);
return true;
case R.id.action_sharp_image:
decoder.adjust_blur(-1);
return true;
case R.id.action_neutral_image:
decoder.adjust_blur(0);
return true;
case R.id.action_soft_image:
decoder.adjust_blur(1);
return true;
case R.id.action_softer_image:
decoder.adjust_blur(2);
return true;
case R.id.action_softest_image:
decoder.adjust_blur(3);
return true;
case R.id.action_toggle_scaling:
decoder.toggle_scaling();
return true;
case R.id.action_toggle_debug:
decoder.toggle_debug();
return true;
case R.id.action_auto_mode:
decoder.auto_mode();
return true;
case R.id.action_toggle_analyzer:
decoder.enable_analyzer(enableAnalyzer ^= true);
changeLayoutOrientation(getResources().getConfiguration());
return true;
case R.id.action_slow_update_rate:
decoder.setUpdateRate(0);
return true;
case R.id.action_normal_update_rate:
decoder.setUpdateRate(1);
return true;
case R.id.action_fast_update_rate:
decoder.setUpdateRate(2);
return true;
case R.id.action_faster_update_rate:
decoder.setUpdateRate(3);
return true;
case R.id.action_fastest_update_rate:
decoder.setUpdateRate(4);
return true;
case R.id.action_raw_mode:
decoder.raw_mode();
return true;
case R.id.action_robot36_mode:
decoder.robot36_mode();
return true;
case R.id.action_robot72_mode:
decoder.robot72_mode();
return true;
case R.id.action_martin1_mode:
decoder.martin1_mode();
return true;
case R.id.action_martin2_mode:
decoder.martin2_mode();
return true;
case R.id.action_scottie1_mode:
decoder.scottie1_mode();
return true;
case R.id.action_scottie2_mode:
decoder.scottie2_mode();
return true;
case R.id.action_scottieDX_mode:
decoder.scottieDX_mode();
return true;
case R.id.action_wraaseSC2_180_mode:
decoder.wraaseSC2_180_mode();
return true;
case R.id.action_pd50_mode:
decoder.pd50_mode();
return true;
case R.id.action_pd90_mode:
decoder.pd90_mode();
return true;
case R.id.action_pd120_mode:
decoder.pd120_mode();
return true;
case R.id.action_pd160_mode:
decoder.pd160_mode();
return true;
case R.id.action_pd180_mode:
decoder.pd180_mode();
return true;
case R.id.action_pd240_mode:
decoder.pd240_mode();
return true;
case R.id.action_pd290_mode:
decoder.pd290_mode();
return true;
case R.id.action_privacy_policy:
showPrivacyPolicy();
return true;
int id = item.getItemId();
if (id == R.id.action_toggle_decoder) {
toggleDecoder();
return true;
}
if (id == R.id.action_save_image) {
storeBitmap(image.bitmap);
return true;
}
if (id == R.id.action_clear_image) {
decoder.clear_image();
return true;
}
if (id == R.id.action_sharpest_image) {
decoder.adjust_blur(-3);
return true;
}
if (id == R.id.action_sharper_image) {
decoder.adjust_blur(-2);
return true;
}
if (id == R.id.action_sharp_image) {
decoder.adjust_blur(-1);
return true;
}
if (id == R.id.action_neutral_image) {
decoder.adjust_blur(0);
return true;
}
if (id == R.id.action_soft_image) {
decoder.adjust_blur(1);
return true;
}
if (id == R.id.action_softer_image) {
decoder.adjust_blur(2);
return true;
}
if (id == R.id.action_softest_image) {
decoder.adjust_blur(3);
return true;
}
if (id == R.id.action_toggle_scaling) {
decoder.toggle_scaling();
return true;
}
if (id == R.id.action_toggle_debug) {
decoder.toggle_debug();
return true;
}
if (id == R.id.action_auto_mode) {
decoder.auto_mode();
return true;
}
if (id == R.id.action_toggle_analyzer) {
decoder.enable_analyzer(enableAnalyzer ^= true);
changeLayoutOrientation(getResources().getConfiguration());
return true;
}
if (id == R.id.action_slow_update_rate) {
decoder.setUpdateRate(0);
return true;
}
if (id == R.id.action_normal_update_rate) {
decoder.setUpdateRate(1);
return true;
}
if (id == R.id.action_fast_update_rate) {
decoder.setUpdateRate(2);
return true;
}
if (id == R.id.action_faster_update_rate) {
decoder.setUpdateRate(3);
return true;
}
if (id == R.id.action_fastest_update_rate) {
decoder.setUpdateRate(4);
return true;
}
if (id == R.id.action_raw_mode) {
decoder.raw_mode();
return true;
}
if (id == R.id.action_robot36_mode) {
decoder.robot36_mode();
return true;
}
if (id == R.id.action_robot72_mode) {
decoder.robot72_mode();
return true;
}
if (id == R.id.action_martin1_mode) {
decoder.martin1_mode();
return true;
}
if (id == R.id.action_martin2_mode) {
decoder.martin2_mode();
return true;
}
if (id == R.id.action_scottie1_mode) {
decoder.scottie1_mode();
return true;
}
if (id == R.id.action_scottie2_mode) {
decoder.scottie2_mode();
return true;
}
if (id == R.id.action_scottieDX_mode) {
decoder.scottieDX_mode();
return true;
}
if (id == R.id.action_wraaseSC2_180_mode) {
decoder.wraaseSC2_180_mode();
return true;
}
if (id == R.id.action_pd50_mode) {
decoder.pd50_mode();
return true;
}
if (id == R.id.action_pd90_mode) {
decoder.pd90_mode();
return true;
}
if (id == R.id.action_pd120_mode) {
decoder.pd120_mode();
return true;
}
if (id == R.id.action_pd160_mode) {
decoder.pd160_mode();
return true;
}
if (id == R.id.action_pd180_mode) {
decoder.pd180_mode();
return true;
}
if (id == R.id.action_pd240_mode) {
decoder.pd240_mode();
return true;
}
if (id == R.id.action_pd290_mode) {
decoder.pd290_mode();
return true;
}
if (id == R.id.action_privacy_policy) {
showPrivacyPolicy();
return true;
}
return super.onOptionsItemSelected(item);
}

Wyświetl plik

@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:7.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

Wyświetl plik

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip