added dice roller color background compatibility

This commit is contained in:
r0r-5chach 2023-03-26 21:04:47 +01:00
parent 003ecf879e
commit 42a19f092d
2 changed files with 7 additions and 2 deletions

View File

@ -1,17 +1,21 @@
package xyz.r0r5chach.cpsAssist.dice;
import android.graphics.Color;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import xyz.r0r5chach.cpsAssist.R;
import xyz.r0r5chach.cpsAssist.dice.BtnOnClickListener;
public class DiceActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dice);
setTitle("Dice Roller- " + getIntent().getStringExtra("username"));
if (getIntent().hasExtra("background")) {
findViewById(R.id.dice_layout).setBackgroundColor(Color.parseColor(getIntent().getStringExtra("background")));
}
findViewById(R.id.dice_roll_button).setOnClickListener(new BtnOnClickListener());
}

View File

@ -2,7 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:id="@+id/dice_layout">
<TextView
android:id="@+id/dice_output"