-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional ImageViewer added at Main Thread.
- Loading branch information
1 parent
b4feac1
commit b3a08ff
Showing
7 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/assistant/android/bolchal/ImageViewer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.assistant.android.bolchal; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.appcompat.widget.Toolbar; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.Parcelable; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import com.bumptech.glide.Glide; | ||
|
||
import java.util.Objects; | ||
|
||
public class ImageViewer extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.layout_image_viewer); | ||
|
||
/** | ||
* Toolbar/ActionBar transparent | ||
*/ | ||
Objects.requireNonNull(getSupportActionBar()).hide(); | ||
|
||
ImageView image = (ImageView) findViewById(R.id.image_view_holder); | ||
TextView name = findViewById(R.id.img_action_name); | ||
TextView timeDate = findViewById(R.id.img_action_date); | ||
ImageView back = findViewById(R.id.img_action_back); | ||
ImageView menu = findViewById(R.id.img_action_menu); | ||
|
||
Message message = getIntent().getParcelableExtra("ImageRes"); | ||
Glide.with(image.getContext()).load(message.getPhotoUrl()).into(image); | ||
|
||
name.setText(message.getName()); | ||
timeDate.setText(message.getTime()); | ||
|
||
back.setOnClickListener(view -> { | ||
finish(); | ||
}); | ||
|
||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="124dp" android:tint="#FFFFFF" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="124dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="124dp" android:tint="#FFFFFF" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="124dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/> | ||
</vector> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:background="@color/purple_700"> | ||
|
||
<ImageView | ||
android:id="@+id/img_action_back" | ||
android:layout_width="30dp" | ||
android:layout_height="30dp" | ||
android:src="@drawable/ic_baseline_arrow_back_24" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toStartOf="@+id/img_action_date" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/img_action_name" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="name" | ||
android:textColor="@color/white" | ||
android:textSize="20sp" | ||
app:layout_constraintBottom_toBottomOf="@+id/img_action_back" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.01" /> | ||
|
||
<TextView | ||
android:id="@+id/img_action_date" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="12/11/21, 11:45 PM" | ||
android:textColor="@color/white" | ||
android:textSize="15sp" | ||
app:layout_constraintEnd_toEndOf="@+id/img_action_name" | ||
app:layout_constraintStart_toStartOf="@+id/img_action_name" | ||
app:layout_constraintTop_toBottomOf="@+id/img_action_name" /> | ||
|
||
<ImageView | ||
android:id="@+id/img_action_menu" | ||
android:layout_width="20dp" | ||
android:layout_height="20dp" | ||
android:src="@drawable/three_dots" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/img_action_date" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ImageViewer" | ||
android:background="@color/black"> | ||
|
||
<ImageView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:adjustViewBounds="true" | ||
android:layout_centerInParent="true" | ||
android:id="@+id/image_view_holder" | ||
tools:src="@drawable/placeholder"/> | ||
|
||
<include | ||
android:layout_width="match_parent" | ||
android:layout_height="?android:attr/actionBarSize" | ||
layout="@layout/image_action_bar" | ||
android:id="@+id/tool_bar" | ||
android:layout_alignParentTop="true" | ||
android:layout_alignParentStart="true" | ||
android:background="@color/purple_700"/> | ||
|
||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:id="@+id/delete" android:title="delete" android:orderInCategory="1" /> | ||
|
||
</menu> |