Skip to content

Commit

Permalink
Apply UI theme (4) - Images and image buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
zealotzealot committed Dec 1, 2019
1 parent b4d0348 commit 2df24c3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.view.SurfaceView;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;

public class CameraActivity extends AppCompatActivity {
private SurfaceView surfaceView;
Expand All @@ -24,7 +24,7 @@ protected void onCreate(Bundle savedInstanceState) {
surfaceView = findViewById(R.id.cameraSurfaceView);
cameraPreview = new CameraPreview(this, this, Camera.CameraInfo.CAMERA_FACING_BACK, surfaceView);

Button button = findViewById(R.id.cameraButton);
ImageButton button = findViewById(R.id.cameraButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class MainActivity extends AppCompatActivity {

Expand All @@ -14,8 +14,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Button button = (Button) findViewById(R.id.mainButton);
button.setOnClickListener(new Button.OnClickListener() {
ImageButton button = (ImageButton) findViewById(R.id.mainButton);
button.setOnClickListener(new ImageButton.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, CameraActivity.class);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions android/app/src/main/res/layout/activity_camera.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,18 @@
android:text="Only PW" />
</RadioGroup>

<Button
<ImageButton
android:id="@+id/cameraButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:text="Button"
android:background="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/icon_camera_btn" />

<TextView
android:id="@+id/textView3"
Expand Down
17 changes: 14 additions & 3 deletions android/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
android:layout_height="match_parent"
tools:context="com.example.hsh0908y.auto_wifi.MainActivity">

<Button
<ImageButton
android:id="@+id/mainButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="96dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:text="Button"
android:background="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/icon_main_start" />

<TextView
android:id="@+id/textView"
Expand Down Expand Up @@ -45,4 +46,14 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:translationX="115dp"
app:srcCompat="@drawable/icon_wifi_big" />

</android.support.constraint.ConstraintLayout>

0 comments on commit 2df24c3

Please sign in to comment.