Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace CircleImageView with ShapeableImageView #1464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ dependencies {
}
implementation 'com.mikepenz:aboutlibraries-core-android:11.2.2'
implementation 'com.nulab-inc:zxcvbn:1.9.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'net.lingala.zip4j:zip4j:2.11.5'
implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1'
implementation 'org.simpleflatmapper:sfm-csv:8.2.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import com.google.android.material.chip.Chip;
import com.google.android.material.chip.ChipGroup;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;

Expand All @@ -92,8 +93,6 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import de.hdodenhof.circleimageview.CircleImageView;

public class EditEntryActivity extends AegisActivity {
private boolean _isNew = false;
private boolean _isManual = false;
Expand All @@ -103,7 +102,7 @@ public class EditEntryActivity extends AegisActivity {
// keep track of icon changes separately as the generated jpeg's are not deterministic
private boolean _hasChangedIcon = false;
private IconPack.Icon _selectedIcon;
private CircleImageView _iconView;
private ShapeableImageView _iconView;
private ImageView _saveImageButton;

private TextInputEditText _textName;
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_edit_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
android:layout_width="match_parent"
android:layout_height="250dp">

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/profile_drawable"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
android:layout_centerVertical="true"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<com.avito.android.krop.KropView
android:id="@+id/krop_view"
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/card_assign_icon_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
android:layout_height="wrap_content"
android:orientation="horizontal">

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivOldImage"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_vertical" />
android:layout_gravity="center_vertical"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<ImageView
android:layout_width="32dp"
Expand All @@ -62,11 +63,12 @@
android:layout_marginEnd="15dp"
android:layout_gravity="center_vertical"/>

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivNewImage"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_vertical" />
android:layout_gravity="center_vertical"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<View
android:layout_width="0dp"
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/card_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,24 @@
android:layout_height="match_parent"
android:paddingStart="14dp">

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivTextDrawable"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" />
android:layout_alignParentStart="true"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivSelected"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:src="@drawable/item_selected"
android:visibility="gone"
app:civ_circle_background_color="?attr/colorPrimaryAlternative" />
android:background="?attr/colorPrimaryAlternative"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />
</RelativeLayout>

<RelativeLayout
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/card_entry_compact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,24 @@
android:layout_height="match_parent"
android:paddingStart="12dp">

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivTextDrawable"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true" />
android:layout_centerVertical="true"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivSelected"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:src="@drawable/item_selected"
android:visibility="gone"
app:civ_circle_background_color="?attr/colorPrimaryAlternative" />
android:background="?attr/colorPrimaryAlternative"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />
</RelativeLayout>

<RelativeLayout
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/card_entry_small.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,24 @@
android:layout_height="match_parent"
android:paddingStart="14dp">

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivTextDrawable"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" />
android:layout_alignParentStart="true"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivSelected"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:src="@drawable/item_selected"
android:visibility="gone"
app:civ_circle_background_color="?attr/colorPrimaryAlternative" />
android:background="?attr/colorPrimaryAlternative"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />
</RelativeLayout>

<RelativeLayout
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/card_entry_tile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,24 @@
android:layout_width="wrap_content"
android:layout_height="match_parent">

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivTextDrawable"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:layout_alignParentStart="true" />
android:layout_alignParentStart="true"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />

<de.hdodenhof.circleimageview.CircleImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivSelected"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:layout_alignParentStart="true"
android:src="@drawable/item_selected"
android:visibility="gone"
app:civ_circle_background_color="?attr/colorPrimaryAlternative" />
android:background="?attr/colorPrimaryAlternative"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Aegis.ImageView.Circle" />
</RelativeLayout>

<RelativeLayout
Expand Down
23 changes: 0 additions & 23 deletions app/src/main/res/raw/aboutlibraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -2543,29 +2543,6 @@
"MIT"
]
},
{
"uniqueId": "de.hdodenhof:circleimageview",
"funding": [

],
"developers": [
{
"name": "Henning Dodenhof"
}
],
"artifactVersion": "3.1.0",
"description": "A fast circular ImageView for Android",
"scm": {
"connection": "scm:git@github.com:hdodenhof/CircleImageView.git",
"url": "https://github.com/hdodenhof/CircleImageView",
"developerConnection": "scm:git@github.com:hdodenhof/CircleImageView.git"
},
"name": "CircleImageView",
"website": "https://github.com/hdodenhof/CircleImageView",
"licenses": [
"Apache-2.0"
]
},
{
"uniqueId": "info.guardianproject.trustedintents:trustedintents",
"funding": [
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,9 @@
<item name="cornerFamily">rounded</item>
<item name="cornerSize">8dp</item>
</style>

<style name="ShapeAppearanceOverlay.Aegis.ImageView.Circle" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">50%</item>
</style>
</resources>