Added more options button

pull/175/head
M66B 5 years ago
parent d3819e2164
commit 695fee29b3

@ -43,6 +43,7 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
@ -55,6 +56,7 @@ import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.view.GravityCompat;
import androidx.documentfile.provider.DocumentFile;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentManager;
@ -138,6 +140,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
static final String ACTION_MANAGE_CERTIFICATES = BuildConfig.APPLICATION_ID + ".MANAGE_CERTIFICATES";
static final String ACTION_IMPORT_CERTIFICATE = BuildConfig.APPLICATION_ID + ".IMPORT_CERTIFICATE";
static final String ACTION_SETUP_ADVANCED = BuildConfig.APPLICATION_ID + ".SETUP_ADVANCED";
static final String ACTION_SETUP_MORE = BuildConfig.APPLICATION_ID + ".SETUP_MORE";
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -316,6 +319,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
iff.addAction(ACTION_MANAGE_CERTIFICATES);
iff.addAction(ACTION_IMPORT_CERTIFICATE);
iff.addAction(ACTION_SETUP_ADVANCED);
iff.addAction(ACTION_SETUP_MORE);
lbm.registerReceiver(receiver, iff);
}
@ -1237,6 +1241,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
.show();
}
private void onSetupMore(Intent intent) {
drawerLayout.openDrawer(GravityCompat.START);
}
private static Intent getIntentExport() {
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
@ -1338,6 +1346,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
onImportCertificate(intent);
else if (ACTION_SETUP_ADVANCED.equals(action))
onSetupAdvanced(intent);
else if (ACTION_SETUP_MORE.equals(action))
onSetupMore(intent);
}
}
};

@ -23,6 +23,7 @@ import android.app.ActivityManager;
import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Paint;
@ -44,6 +45,7 @@ import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import io.requery.android.database.sqlite.SQLiteDatabase;
@ -65,6 +67,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Button btnReset;
private Button btnCleanup;
private TextView tvLastCleanup;
private Button btnMore;
private TextView tvProcessors;
private TextView tvMemoryClass;
@ -110,6 +113,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
btnReset = view.findViewById(R.id.btnReset);
btnCleanup = view.findViewById(R.id.btnCleanup);
tvLastCleanup = view.findViewById(R.id.tvLastCleanup);
btnMore = view.findViewById(R.id.btnMore);
tvProcessors = view.findViewById(R.id.tvProcessors);
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
@ -254,6 +258,14 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
btnMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_SETUP_MORE));
}
});
tvFtsIndexed.setText(null);
DB db = DB.getInstance(getContext());

@ -251,6 +251,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCleanupHint" />
<Button
android:id="@+id/btnMore"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_more"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvLastCleanup" />
<TextView
android:id="@+id/tvProcessors"
android:layout_width="0dp"
@ -260,7 +272,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvLastCleanup" />
app:layout_constraintTop_toBottomOf="@id/btnMore" />
<TextView
android:id="@+id/tvMemoryClass"

Loading…
Cancel
Save