Fix SparkButtons (#608)
* fix the SparkButtons * dont notify adapter after boost/fav
This commit is contained in:
parent
48c239338d
commit
89f93eab85
9 changed files with 44 additions and 39 deletions
|
@ -63,7 +63,7 @@ dependencies {
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||||
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
|
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
|
||||||
implementation 'com.pkmmte.view:circularimageview:1.1'
|
implementation 'com.pkmmte.view:circularimageview:1.1'
|
||||||
implementation 'com.github.varunest:sparkbutton:1.0.5'
|
implementation 'com.github.connyduck:sparkbutton:1.0.0'
|
||||||
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
||||||
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
|
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
|
||||||
implementation('com.theartofdev.edmodo:android-image-cropper:2.7.0') {
|
implementation('com.theartofdev.edmodo:android-image-cropper:2.7.0') {
|
||||||
|
|
|
@ -114,7 +114,7 @@ import com.keylesspalace.tusky.view.TootButton;
|
||||||
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
|
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
|
||||||
import com.mikepenz.iconics.IconicsDrawable;
|
import com.mikepenz.iconics.IconicsDrawable;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
import com.varunest.sparkbutton.helpers.Utils;
|
import at.connyduck.sparkbutton.helpers.Utils;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ import com.keylesspalace.tusky.view.RoundedTransformation;
|
||||||
import com.keylesspalace.tusky.viewdata.StatusViewData;
|
import com.keylesspalace.tusky.viewdata.StatusViewData;
|
||||||
import com.mikepenz.iconics.utils.Utils;
|
import com.mikepenz.iconics.utils.Utils;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
import com.varunest.sparkbutton.SparkButton;
|
import at.connyduck.sparkbutton.SparkButton;
|
||||||
import com.varunest.sparkbutton.SparkEventListener;
|
import at.connyduck.sparkbutton.SparkEventListener;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -28,7 +28,7 @@ import com.keylesspalace.tusky.util.ThemeUtils;
|
||||||
import com.keylesspalace.tusky.view.RoundedTransformation;
|
import com.keylesspalace.tusky.view.RoundedTransformation;
|
||||||
import com.keylesspalace.tusky.viewdata.StatusViewData;
|
import com.keylesspalace.tusky.viewdata.StatusViewData;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
import com.varunest.sparkbutton.helpers.Utils;
|
import at.connyduck.sparkbutton.helpers.Utils;
|
||||||
|
|
||||||
public class StatusViewHolder extends StatusBaseViewHolder {
|
public class StatusViewHolder extends StatusBaseViewHolder {
|
||||||
private ImageView avatarReblog;
|
private ImageView avatarReblog;
|
||||||
|
|
|
@ -216,7 +216,7 @@ public final class ViewThreadFragment extends SFragment implements
|
||||||
StatusViewData.Concrete newViewData = viewDataBuilder.createStatusViewData();
|
StatusViewData.Concrete newViewData = viewDataBuilder.createStatusViewData();
|
||||||
|
|
||||||
statuses.setPairedItem(position, newViewData);
|
statuses.setPairedItem(position, newViewData);
|
||||||
adapter.setItem(position, newViewData, true);
|
adapter.setItem(position, newViewData, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ public final class ViewThreadFragment extends SFragment implements
|
||||||
StatusViewData.Concrete newViewData = viewDataBuilder.createStatusViewData();
|
StatusViewData.Concrete newViewData = viewDataBuilder.createStatusViewData();
|
||||||
|
|
||||||
statuses.setPairedItem(position, newViewData);
|
statuses.setPairedItem(position, newViewData);
|
||||||
adapter.setItem(position, newViewData, true);
|
adapter.setItem(position, newViewData, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import android.support.v7.widget.AppCompatImageView;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
import com.keylesspalace.tusky.R;
|
import com.keylesspalace.tusky.R;
|
||||||
import com.varunest.sparkbutton.helpers.Utils;
|
import at.connyduck.sparkbutton.helpers.Utils;
|
||||||
|
|
||||||
public final class ProgressImageView extends AppCompatImageView {
|
public final class ProgressImageView extends AppCompatImageView {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:sparkbutton="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/status_container"
|
android:id="@+id/status_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:clipChildren="false"
|
||||||
|
android:clipToPadding="false"
|
||||||
android:paddingLeft="14dp"
|
android:paddingLeft="14dp"
|
||||||
android:paddingRight="14dp">
|
android:paddingRight="14dp">
|
||||||
|
|
||||||
|
@ -124,7 +127,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_below="@+id/status_name_bar"
|
android:layout_below="@+id/status_name_bar"
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:layout_toEndOf="@+id/status_avatar"
|
android:layout_toEndOf="@+id/status_avatar"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:lineSpacingMultiplier="1.1"
|
android:lineSpacingMultiplier="1.1"
|
||||||
|
@ -137,7 +139,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/status_content"
|
android:layout_below="@+id/status_content"
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:layout_marginTop="@dimen/status_media_preview_margin_top"
|
android:layout_marginTop="@dimen/status_media_preview_margin_top"
|
||||||
android:layout_toEndOf="@+id/status_avatar">
|
android:layout_toEndOf="@+id/status_avatar">
|
||||||
|
|
||||||
|
@ -285,12 +286,13 @@
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="4dp">
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingTop="4dp">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/status_reply"
|
android:id="@+id/status_reply"
|
||||||
style="?attr/image_button_style"
|
style="?attr/image_button_style"
|
||||||
android:layout_width="24dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/action_reply"
|
android:contentDescription="@string/action_reply"
|
||||||
|
@ -303,34 +305,34 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
<at.connyduck.sparkbutton.SparkButton
|
||||||
android:id="@+id/status_reblog"
|
android:id="@+id/status_reblog"
|
||||||
android:layout_width="24dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:contentDescription="@string/action_reblog"
|
android:contentDescription="@string/action_reblog"
|
||||||
app:sparkbutton_activeImage="@drawable/reblog_active"
|
sparkbutton:activeImage="@drawable/reblog_active"
|
||||||
app:sparkbutton_iconSize="24dp"
|
sparkbutton:iconSize="24dp"
|
||||||
app:sparkbutton_inActiveImage="?attr/status_reblog_inactive_drawable"
|
sparkbutton:inactiveImage="?attr/status_reblog_inactive_drawable"
|
||||||
app:sparkbutton_primaryColor="@color/status_reblog_button_marked_dark"
|
sparkbutton:primaryColor="@color/status_reblog_button_marked_dark"
|
||||||
app:sparkbutton_secondaryColor="@color/status_reblog_button_marked_light" />
|
sparkbutton:secondaryColor="@color/status_reblog_button_marked_light" />
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
<at.connyduck.sparkbutton.SparkButton
|
||||||
android:id="@+id/status_favourite"
|
android:id="@+id/status_favourite"
|
||||||
android:layout_width="24dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:contentDescription="@string/action_favourite"
|
android:contentDescription="@string/action_favourite"
|
||||||
app:sparkbutton_activeImage="?attr/status_favourite_active_drawable"
|
sparkbutton:activeImage="?attr/status_favourite_active_drawable"
|
||||||
app:sparkbutton_iconSize="24dp"
|
sparkbutton:iconSize="24dp"
|
||||||
app:sparkbutton_inActiveImage="?attr/status_favourite_inactive_drawable"
|
sparkbutton:inactiveImage="?attr/status_favourite_inactive_drawable"
|
||||||
app:sparkbutton_primaryColor="@color/status_favourite_button_marked_dark"
|
sparkbutton:primaryColor="@color/status_favourite_button_marked_dark"
|
||||||
app:sparkbutton_secondaryColor="@color/status_favourite_button_marked_light" />
|
sparkbutton:secondaryColor="@color/status_favourite_button_marked_light" />
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:sparkbutton="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/status_container"
|
android:id="@+id/status_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:clipChildren="false"
|
||||||
|
android:clipToPadding="false"
|
||||||
android:paddingLeft="14dp"
|
android:paddingLeft="14dp"
|
||||||
android:paddingRight="14dp">
|
android:paddingRight="14dp">
|
||||||
|
|
||||||
|
@ -330,18 +333,18 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
<at.connyduck.sparkbutton.SparkButton
|
||||||
android:id="@+id/status_reblog"
|
android:id="@+id/status_reblog"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:contentDescription="@string/action_reblog"
|
android:contentDescription="@string/action_reblog"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
app:sparkbutton_activeImage="@drawable/reblog_active"
|
sparkbutton:activeImage="@drawable/reblog_active"
|
||||||
app:sparkbutton_iconSize="28dp"
|
sparkbutton:iconSize="28dp"
|
||||||
app:sparkbutton_inActiveImage="?attr/status_reblog_inactive_drawable"
|
sparkbutton:inactiveImage="?attr/status_reblog_inactive_drawable"
|
||||||
app:sparkbutton_primaryColor="@color/status_reblog_button_marked_dark"
|
sparkbutton:primaryColor="@color/status_reblog_button_marked_dark"
|
||||||
app:sparkbutton_secondaryColor="@color/status_reblog_button_marked_light" />
|
sparkbutton:secondaryColor="@color/status_reblog_button_marked_light" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status_reblogs"
|
android:id="@+id/status_reblogs"
|
||||||
|
@ -354,18 +357,18 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.varunest.sparkbutton.SparkButton
|
<at.connyduck.sparkbutton.SparkButton
|
||||||
android:id="@+id/status_favourite"
|
android:id="@+id/status_favourite"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:contentDescription="@string/action_favourite"
|
android:contentDescription="@string/action_favourite"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
app:sparkbutton_activeImage="?attr/status_favourite_active_drawable"
|
sparkbutton:activeImage="?attr/status_favourite_active_drawable"
|
||||||
app:sparkbutton_iconSize="28dp"
|
sparkbutton:iconSize="28dp"
|
||||||
app:sparkbutton_inActiveImage="?attr/status_favourite_inactive_drawable"
|
sparkbutton:inactiveImage="?attr/status_favourite_inactive_drawable"
|
||||||
app:sparkbutton_primaryColor="@color/status_favourite_button_marked_dark"
|
sparkbutton:primaryColor="@color/status_favourite_button_marked_dark"
|
||||||
app:sparkbutton_secondaryColor="@color/status_favourite_button_marked_light" />
|
sparkbutton:secondaryColor="@color/status_favourite_button_marked_light" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status_favourites"
|
android:id="@+id/status_favourites"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<dimen name="status_display_name_padding_end">4dp</dimen>
|
<dimen name="status_display_name_padding_end">4dp</dimen>
|
||||||
<dimen name="status_avatar_padding">10dp</dimen>
|
<dimen name="status_avatar_padding">10dp</dimen>
|
||||||
<dimen name="status_reblogged_bar_padding_top">8dp</dimen>
|
<dimen name="status_reblogged_bar_padding_top">8dp</dimen>
|
||||||
<dimen name="status_media_preview_margin_top">4dp</dimen>
|
<dimen name="status_media_preview_margin_top">8dp</dimen>
|
||||||
<dimen name="status_media_preview_height">100dp</dimen>
|
<dimen name="status_media_preview_height">100dp</dimen>
|
||||||
<dimen name="status_detail_media_preview_height">130dp</dimen>
|
<dimen name="status_detail_media_preview_height">130dp</dimen>
|
||||||
<dimen name="compose_media_preview_margin">8dp</dimen>
|
<dimen name="compose_media_preview_margin">8dp</dimen>
|
||||||
|
|
Loading…
Reference in a new issue