Skip to content

Commit

Permalink
Merge pull request #331 from ourfor/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ourfor authored Dec 14, 2024
2 parents fb426d7 + da8f1df commit 0110469
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
import android.content.DialogInterface;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Size;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
Expand Down Expand Up @@ -184,15 +187,16 @@ void setupSelection() {

public void onItemClick() {
val context = getContext();
AlertDialog.Builder builder = new AlertDialog.Builder(context);
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.SettingItemDialog);

builder.setTitle(model.title);

List<String> buttonTitles = new ArrayList<>();
if (model.type == SettingType.SWITCH) {
buttonTitles.add(context.getString(R.string.turn_on));
buttonTitles.add(context.getString(R.string.turn_off));
} else if (model.type == SettingType.SELECT) {
} else if (model.type == SettingType.SELECT ||
model.type == SettingType.SPINNER) {
for (val option : model.options) {
buttonTitles.add(option.toString());
}
Expand Down
6 changes: 6 additions & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
<item name="android:windowAnimationStyle">@style/DialogAnimation</item>
</style>

<style name="SettingItemDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowBackground">@drawable/dialog_bg</item>
<item name="android:textColor">@color/onBackground</item>
<item name="colorAccent">@color/onBackground</item>
</style>

<style name="SiteBottomSheetStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/dialog_bg</item>
<item name="android:paddingTop">5dp</item>
Expand Down

0 comments on commit 0110469

Please sign in to comment.