Rca/fix UI #15

Merged
r-ca merged 30 commits from rca/fix_ui into main 2024-01-17 10:27:28 +00:00
3 changed files with 58 additions and 1 deletions
Showing only changes of commit 3538c61582 - Show all commits

View File

@ -8,8 +8,14 @@ import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat; import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.appbar.MaterialToolbar;
import java.util.Objects;
public class QrControlActivity extends AppCompatActivity { public class QrControlActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -20,5 +26,25 @@ public class QrControlActivity extends AppCompatActivity {
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets; return insets;
}); });
MaterialToolbar toolbar = findViewById(R.id.qr_control_toolbar);
setSupportActionBar(toolbar);
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(android.view.Menu menu) {
getMenuInflater().inflate(R.menu.qr_preview_manu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(android.view.MenuItem item) {
if (item.getItemId() == R.id.print_qr) {
}
return super.onOptionsItemSelected(item);
} }
} }

View File

@ -5,6 +5,29 @@
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".QrControlActivity"> tools:context=".GeneratedQrFragment" >
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/qr_control_toolbar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/white"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:title="Preview"/>
<ImageView
android:id="@+id/result_bitmap_image_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/close_fill0_wght400_grad0_opsz24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/print_qr"
android:icon="@drawable/ic_home_black_24dp"
android:title="Print"/>
</menu>