mirror of https://github.com/MISP/misp-bump
commit
9fbef90f91
|
@ -19,6 +19,11 @@ android {
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = '1.8'
|
||||||
|
targetCompatibility = '1.8'
|
||||||
|
}
|
||||||
|
buildToolsVersion = '29.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import android.content.res.ColorStateList;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
@ -246,14 +245,12 @@ public class ExchangeActivity extends AppCompatActivity {
|
||||||
View view = findViewById(R.id.fragmentContainer);
|
View view = findViewById(R.id.fragmentContainer);
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
Log.d("DEBUG", "cameraPreview enabled");
|
|
||||||
view.animate()
|
view.animate()
|
||||||
.alpha(1f)
|
.alpha(1f)
|
||||||
.setDuration(250)
|
.setDuration(250)
|
||||||
.start();
|
.start();
|
||||||
cameraFragment.setReadQrEnabled(true);
|
cameraFragment.setReadQrEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
Log.d("DEBUG", "cameraPreview disabled");
|
|
||||||
view.animate()
|
view.animate()
|
||||||
.alpha(0f)
|
.alpha(0f)
|
||||||
.setDuration(250)
|
.setDuration(250)
|
||||||
|
|
|
@ -3,7 +3,6 @@ package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -70,9 +69,6 @@ public class HomeActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
Log.d("DEBUG", "onResume()");
|
|
||||||
|
|
||||||
refreshRecyclerView();
|
refreshRecyclerView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,14 @@ package lu.circl.mispbump.activities;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
import lu.circl.mispbump.R;
|
||||||
import lu.circl.mispbump.fragments.PreferencesFragment;
|
|
||||||
|
|
||||||
|
|
||||||
public class PreferenceActivity extends AppCompatActivity {
|
public class PreferenceActivity extends AppCompatActivity {
|
||||||
|
@ -25,9 +26,21 @@ public class PreferenceActivity extends AppCompatActivity {
|
||||||
Toolbar myToolbar = findViewById(R.id.toolbar);
|
Toolbar myToolbar = findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(myToolbar);
|
setSupportActionBar(myToolbar);
|
||||||
|
|
||||||
|
ActionBar ab = getSupportActionBar();
|
||||||
|
assert ab != null;
|
||||||
|
ab.setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||||
fragmentTransaction.add(R.id.fragmentContainer, new PreferencesFragment(), PreferencesFragment.class.getSimpleName());
|
fragmentTransaction.add(R.id.fragmentContainer, new PreferencesFragment(), PreferencesFragment.class.getSimpleName());
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class PreferencesFragment extends PreferenceFragmentCompat {
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
setPreferencesFromResource(R.xml.preference_screen_main, rootKey);
|
||||||
|
findPreference("PREF_DELETE_ALL_SYNCS").setOnPreferenceClickListener(preference -> true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
package lu.circl.mispbump.fragments;
|
|
||||||
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
|
||||||
|
|
||||||
import lu.circl.mispbump.R;
|
|
||||||
|
|
||||||
|
|
||||||
public class PreferencesFragment extends PreferenceFragmentCompat {
|
|
||||||
@Override
|
|
||||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
|
||||||
setPreferencesFromResource(R.xml.preference_screen_main, rootKey);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
package lu.circl.mispbump.fragments;
|
|
||||||
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
|
||||||
import androidx.fragment.app.FragmentPagerAdapter;
|
|
||||||
|
|
||||||
|
|
||||||
public class SyncFragmentAdapter extends FragmentPagerAdapter {
|
|
||||||
|
|
||||||
public CameraFragment cameraFragment_1, cameraFragment_2;
|
|
||||||
private UploadSettingsFragment uploadSettingsFragment;
|
|
||||||
|
|
||||||
public SyncFragmentAdapter(@NonNull FragmentManager fm) {
|
|
||||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
private CameraFragment.QrScanCallback scanCallback;
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public Fragment getItem(int position) {
|
|
||||||
switch (position) {
|
|
||||||
case 0:
|
|
||||||
if (cameraFragment_1 == null) {
|
|
||||||
cameraFragment_1 = new CameraFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scanCallback != null) {
|
|
||||||
cameraFragment_1.setOnQrAvailableListener(scanCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cameraFragment_1;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
if (cameraFragment_2 == null) {
|
|
||||||
cameraFragment_2 = new CameraFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scanCallback != null) {
|
|
||||||
cameraFragment_1.setOnQrAvailableListener(scanCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cameraFragment_2;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
if (uploadSettingsFragment == null) {
|
|
||||||
uploadSettingsFragment = new UploadSettingsFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
return uploadSettingsFragment;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return new CameraFragment();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQrReceivedCallback(CameraFragment.QrScanCallback qrScanCallback) {
|
|
||||||
this.scanCallback = qrScanCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void disableCameraPreview() {
|
|
||||||
if (cameraFragment_1 != null) {
|
|
||||||
// cameraFragment_1.disablePreview();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cameraFragment_2 != null) {
|
|
||||||
// cameraFragment_2.disablePreview();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount() {
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M12,2A10,10 0,0 0,2 12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0,0 0,12 2Z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<vector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
android:fillColor="#000"
|
||||||
|
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,16h2v2h-2zM12.61,6.04c-2.06,-0.3 -3.88,0.97 -4.43,2.79 -0.18,0.58 0.26,1.17 0.87,1.17h0.2c0.41,0 0.74,-0.29 0.88,-0.67 0.32,-0.89 1.27,-1.5 2.3,-1.28 0.95,0.2 1.65,1.13 1.57,2.1 -0.1,1.34 -1.62,1.63 -2.45,2.88 0,0.01 -0.01,0.01 -0.01,0.02 -0.01,0.02 -0.02,0.03 -0.03,0.05 -0.09,0.15 -0.18,0.32 -0.25,0.5 -0.01,0.03 -0.03,0.05 -0.04,0.08 -0.01,0.02 -0.01,0.04 -0.02,0.07 -0.12,0.34 -0.2,0.75 -0.2,1.25h2c0,-0.42 0.11,-0.77 0.28,-1.07 0.02,-0.03 0.03,-0.06 0.05,-0.09 0.08,-0.14 0.18,-0.27 0.28,-0.39 0.01,-0.01 0.02,-0.03 0.03,-0.04 0.1,-0.12 0.21,-0.23 0.33,-0.34 0.96,-0.91 2.26,-1.65 1.99,-3.56 -0.24,-1.74 -1.61,-3.21 -3.35,-3.47z"
|
||||||
|
/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<vector
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:width="24dp"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
android:fillColor="#000"
|
||||||
|
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"
|
||||||
|
/>
|
||||||
|
</vector>
|
|
@ -44,4 +44,9 @@
|
||||||
<string name="public_key_received_hint">Öffentlicher Schlüssel empfangen</string>
|
<string name="public_key_received_hint">Öffentlicher Schlüssel empfangen</string>
|
||||||
<string name="sync_info_received_hint">Synchronisations-Informationen empfangen</string>
|
<string name="sync_info_received_hint">Synchronisations-Informationen empfangen</string>
|
||||||
<string name="sync_information">Synchronisations-Informationen</string>
|
<string name="sync_information">Synchronisations-Informationen</string>
|
||||||
</resources>
|
<string name="preference_delete_all_syncs">Alle Synchronisierungen löschen</string>
|
||||||
|
<string name="preference_delete_all_syncs_summary">Die Synchronisierungen werden nur lokal gelöscht</string>
|
||||||
|
<string name="preference_category_general">Allgemein</string>
|
||||||
|
<string name="preference_github_summary">Besuchen Sie das Github Projekt</string>
|
||||||
|
<string name="preference_category_information">App Informationen</string>
|
||||||
|
</resources>
|
||||||
|
|
|
@ -50,4 +50,9 @@
|
||||||
<string name="public_key_received_hint">Received public key</string>
|
<string name="public_key_received_hint">Received public key</string>
|
||||||
<string name="sync_info_received_hint">Received sync information</string>
|
<string name="sync_info_received_hint">Received sync information</string>
|
||||||
<string name="sync_information">Sync Information</string>
|
<string name="sync_information">Sync Information</string>
|
||||||
|
<string name="preference_delete_all_syncs">Delete all synchronisations</string>
|
||||||
|
<string name="preference_delete_all_syncs_summary">This will only delete local data</string>
|
||||||
|
<string name="preference_category_general">General</string>
|
||||||
|
<string name="preference_category_information">App information</string>
|
||||||
|
<string name="preference_github_summary">Visit the Github project</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,16 +1,28 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
>
|
|
||||||
|
|
||||||
<PreferenceCategory android:title="General">
|
<PreferenceCategory android:title="@string/preference_category_general">
|
||||||
<ListPreference
|
<Preference
|
||||||
app:key="language"
|
android:key="PREF_DELETE_ALL_SYNCS"
|
||||||
app:title="Language"
|
android:icon="@drawable/ic_delete_forever"
|
||||||
app:entries="@array/language_name_array"
|
android:title="@string/preference_delete_all_syncs"
|
||||||
app:entryValues="@array/language_value_array"
|
android:summary="@string/preference_delete_all_syncs_summary"/>
|
||||||
app:icon="@drawable/ic_language"
|
</PreferenceCategory>
|
||||||
/>
|
|
||||||
|
<PreferenceCategory android:title="@string/preference_category_information">
|
||||||
|
<Preference
|
||||||
|
android:icon="@drawable/ic_github"
|
||||||
|
android:title="Github"
|
||||||
|
android:summary="@string/preference_github_summary">
|
||||||
|
<intent
|
||||||
|
android:action="android.intent.action.VIEW"
|
||||||
|
android:data="https://github.com/MISP/misp-bump"/>
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:icon="@drawable/ic_info_outline_dark"
|
||||||
|
android:title="Version"
|
||||||
|
android:summary="1.1.2"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
Loading…
Reference in New Issue