parent
3d99ead56c
commit
cec66477ae
|
@ -10,7 +10,7 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
|
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
|
||||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||||
classpath 'com.google.gms:google-services:2.1.0'
|
classpath 'com.google.gms:google-services:3.0.0'
|
||||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||||
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:3.0.0') {
|
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:3.0.0') {
|
||||||
// should be excluded to avoid conflict
|
// should be excluded to avoid conflict
|
||||||
|
|
|
@ -23,7 +23,7 @@ apply plugin: 'com.neenbedankt.android-apt'
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "3.0"
|
versionName "3.0"
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ dependencies {
|
||||||
apt 'com.bluelinelabs:logansquare-compiler:1.3.7'
|
apt 'com.bluelinelabs:logansquare-compiler:1.3.7'
|
||||||
apt 'com.hannesdorfmann.parcelableplease:processor:1.0.2'
|
apt 'com.hannesdorfmann.parcelableplease:processor:1.0.2'
|
||||||
apt 'com.github.mariotaku.ObjectCursor:processor:0.9.7'
|
apt 'com.github.mariotaku.ObjectCursor:processor:0.9.7'
|
||||||
compile 'com.android.support:support-annotations:23.4.0'
|
compile 'com.android.support:support-annotations:24.0.0'
|
||||||
compile 'com.bluelinelabs:logansquare:1.3.7'
|
compile 'com.bluelinelabs:logansquare:1.3.7'
|
||||||
compile 'com.github.mariotaku.RestFu:library:0.9.30'
|
compile 'com.github.mariotaku.RestFu:library:0.9.30'
|
||||||
compile 'com.github.mariotaku.RestFu:oauth:0.9.30'
|
compile 'com.github.mariotaku.RestFu:oauth:0.9.30'
|
||||||
|
|
|
@ -22,7 +22,7 @@ apply plugin: 'com.android.library'
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.mariotaku.twidere.donate.nyanwp"
|
applicationId "org.mariotaku.twidere.donate.nyanwp"
|
||||||
minSdkVersion 20
|
minSdkVersion 20
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.mariotaku.twidere.donate.nyanwp"
|
applicationId "org.mariotaku.twidere.donate.nyanwp"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 3
|
versionCode 3
|
||||||
versionName "1.2"
|
versionName "1.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ apply plugin: 'com.android.library'
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.mariotaku.twidere"
|
applicationId "org.mariotaku.twidere"
|
||||||
minSdkVersion 20
|
minSdkVersion 20
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
@ -39,5 +39,5 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile 'com.google.android.support:wearable:1.3.0'
|
compile 'com.google.android.support:wearable:1.3.0'
|
||||||
compile 'com.google.android.gms:play-services-wearable:8.4.0'
|
compile 'com.google.android.gms:play-services-wearable:9.0.2'
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,9 +105,8 @@ dependencies {
|
||||||
compile project(':twidere.component.nyan')
|
compile project(':twidere.component.nyan')
|
||||||
|
|
||||||
// START Non-FOSS component
|
// START Non-FOSS component
|
||||||
googleCompile 'com.google.android.gms:play-services-maps:8.4.0'
|
googleCompile 'com.google.android.gms:play-services-maps:9.0.2'
|
||||||
googleCompile 'com.google.android.gms:play-services-auth:8.4.0'
|
googleCompile 'com.google.android.gms:play-services-auth:9.0.2'
|
||||||
googleCompile 'com.google.android.gms:play-services-measurement:8.4.0'
|
|
||||||
googleCompile 'com.google.maps.android:android-maps-utils:0.4.3'
|
googleCompile 'com.google.maps.android:android-maps-utils:0.4.3'
|
||||||
googleCompile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true }
|
googleCompile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true }
|
||||||
googleCompile ':YouTubeAndroidPlayerApi:1.2.2@jar'
|
googleCompile ':YouTubeAndroidPlayerApi:1.2.2@jar'
|
||||||
|
@ -123,17 +122,17 @@ dependencies {
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
|
|
||||||
androidTestCompile 'com.android.support:support-annotations:23.4.0'
|
androidTestCompile 'com.android.support:support-annotations:24.0.0'
|
||||||
androidTestCompile 'com.android.support.test:runner:0.5'
|
androidTestCompile 'com.android.support.test:runner:0.5'
|
||||||
androidTestCompile 'com.android.support.test:rules:0.5'
|
androidTestCompile 'com.android.support.test:rules:0.5'
|
||||||
|
|
||||||
compile 'com.android.support:multidex:1.0.1'
|
compile 'com.android.support:multidex:1.0.1'
|
||||||
compile 'com.android.support:support-v13:23.4.0'
|
compile 'com.android.support:support-v13:24.0.0'
|
||||||
compile 'com.android.support:appcompat-v7:23.4.0'
|
compile 'com.android.support:appcompat-v7:24.0.0'
|
||||||
compile 'com.android.support:cardview-v7:23.4.0'
|
compile 'com.android.support:cardview-v7:24.0.0'
|
||||||
compile 'com.android.support:recyclerview-v7:23.4.0'
|
compile 'com.android.support:recyclerview-v7:24.0.0'
|
||||||
compile 'com.android.support:preference-v7:23.4.0'
|
compile 'com.android.support:preference-v7:24.0.0'
|
||||||
compile 'com.android.support:preference-v14:23.4.0'
|
compile 'com.android.support:preference-v14:24.0.0'
|
||||||
compile 'com.twitter:twitter-text:1.13.0'
|
compile 'com.twitter:twitter-text:1.13.0'
|
||||||
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
||||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
|
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
|
||||||
|
|
|
@ -38,14 +38,14 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
|
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
|
||||||
|
|
||||||
private Drawable mDivider;
|
private final Rect mPaddingRect = new Rect();
|
||||||
|
private final Drawable mDivider;
|
||||||
|
|
||||||
private int mOrientation;
|
private int mOrientation;
|
||||||
private Rect mPadding;
|
private Padding mPadding;
|
||||||
private int mDecorationStart = -1, mDecorationEnd = -1, mDecorationEndOffset;
|
private int mDecorationStart = -1, mDecorationEnd = -1, mDecorationEndOffset;
|
||||||
|
|
||||||
public DividerItemDecoration(Context context, int orientation) {
|
public DividerItemDecoration(Context context, int orientation) {
|
||||||
mPadding = new Rect();
|
|
||||||
final TypedArray a = context.obtainStyledAttributes(ATTRS);
|
final TypedArray a = context.obtainStyledAttributes(ATTRS);
|
||||||
mDivider = a.getDrawable(0);
|
mDivider = a.getDrawable(0);
|
||||||
a.recycle();
|
a.recycle();
|
||||||
|
@ -83,8 +83,18 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPadding(int left, int top, int right, int bottom) {
|
public void setPadding(final int left, final int top, final int right, final int bottom) {
|
||||||
mPadding.set(left, top, right, bottom);
|
mPadding = new Padding() {
|
||||||
|
@Override
|
||||||
|
public boolean get(int position, Rect rect) {
|
||||||
|
rect.set(left, top, right, bottom);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPadding(Padding padding) {
|
||||||
|
mPadding = padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawVertical(Canvas c, RecyclerView parent) {
|
public void drawVertical(Canvas c, RecyclerView parent) {
|
||||||
|
@ -104,8 +114,12 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
final int top = child.getBottom() + params.bottomMargin +
|
final int top = child.getBottom() + params.bottomMargin +
|
||||||
Math.round(ViewCompat.getTranslationY(child));
|
Math.round(ViewCompat.getTranslationY(child));
|
||||||
final int bottom = top + mDivider.getIntrinsicHeight();
|
final int bottom = top + mDivider.getIntrinsicHeight();
|
||||||
mDivider.setBounds(left + mPadding.left, top + mPadding.top, right - mPadding.right,
|
if (mPadding != null && mPadding.get(childPos, mPaddingRect)) {
|
||||||
bottom - mPadding.bottom);
|
mDivider.setBounds(left + mPaddingRect.left, top + mPaddingRect.top, right - mPaddingRect.right,
|
||||||
|
bottom - mPaddingRect.bottom);
|
||||||
|
} else {
|
||||||
|
mDivider.setBounds(left, top, right, bottom);
|
||||||
|
}
|
||||||
mDivider.draw(c);
|
mDivider.draw(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,8 +145,9 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
final int left = child.getRight() + params.rightMargin +
|
final int left = child.getRight() + params.rightMargin +
|
||||||
Math.round(ViewCompat.getTranslationX(child));
|
Math.round(ViewCompat.getTranslationX(child));
|
||||||
final int right = left + mDivider.getIntrinsicHeight();
|
final int right = left + mDivider.getIntrinsicHeight();
|
||||||
mDivider.setBounds(left + mPadding.left, top + mPadding.top, right - mPadding.right,
|
|
||||||
bottom - mPadding.bottom);
|
mDivider.setBounds(left + mPaddingRect.left, top + mPaddingRect.top, right - mPaddingRect.right,
|
||||||
|
bottom - mPaddingRect.bottom);
|
||||||
mDivider.draw(c);
|
mDivider.draw(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,4 +181,8 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
private int getDecorationStart() {
|
private int getDecorationStart() {
|
||||||
return mDecorationStart;
|
return mDecorationStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface Padding {
|
||||||
|
boolean get(int position, Rect rect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ package org.mariotaku.twidere.fragment;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
@ -598,25 +599,6 @@ public abstract class AbsActivitiesFragment extends AbsContentListRecyclerViewFr
|
||||||
return new Rect(0, paddingVertical, 0, paddingVertical);
|
return new Rect(0, paddingVertical, 0, paddingVertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setupRecyclerView(Context context, RecyclerView recyclerView) {
|
|
||||||
final ParcelableActivitiesAdapter adapter = getAdapter();
|
|
||||||
// Dividers are drawn on bottom of view
|
|
||||||
recyclerView.addItemDecoration(new DividerItemDecoration(context, getLayoutManager().getOrientation()) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean isDividerEnabled(int childPos) {
|
|
||||||
// Don't draw for last item
|
|
||||||
if (childPos == RecyclerView.NO_POSITION || childPos == adapter.getItemCount() - 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final int itemViewType = adapter.getItemViewType(childPos);
|
|
||||||
return itemViewType != ParcelableActivitiesAdapter.ITEM_VIEW_TYPE_EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
|
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
|
||||||
if (!getUserVisibleHint() || menuInfo == null) return;
|
if (!getUserVisibleHint() || menuInfo == null) return;
|
||||||
|
@ -663,6 +645,39 @@ public abstract class AbsActivitiesFragment extends AbsContentListRecyclerViewFr
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
protected RecyclerView.ItemDecoration createItemDecoration(Context context, final RecyclerView recyclerView, final LinearLayoutManager layoutManager) {
|
||||||
|
final ParcelableActivitiesAdapter adapter = getAdapter();
|
||||||
|
final DividerItemDecoration itemDecoration = new DividerItemDecoration(context,
|
||||||
|
((LinearLayoutManager) recyclerView.getLayoutManager()).getOrientation());
|
||||||
|
final Resources res = context.getResources();
|
||||||
|
if (adapter.isProfileImageEnabled()) {
|
||||||
|
final int decorPaddingLeft = res.getDimensionPixelSize(R.dimen.element_spacing_normal) * 2
|
||||||
|
+ res.getDimensionPixelSize(R.dimen.icon_size_status_profile_image);
|
||||||
|
itemDecoration.setPadding(new DividerItemDecoration.Padding() {
|
||||||
|
@Override
|
||||||
|
public boolean get(int position, Rect rect) {
|
||||||
|
final int itemViewType = adapter.getItemViewType(position);
|
||||||
|
boolean nextItemIsStatus = false;
|
||||||
|
if (position < adapter.getItemCount() - 1) {
|
||||||
|
nextItemIsStatus = adapter.getItemViewType(position + 1) == ParcelableActivitiesAdapter.ITEM_VIEW_TYPE_STATUS;
|
||||||
|
}
|
||||||
|
if (nextItemIsStatus && itemViewType == ParcelableActivitiesAdapter.ITEM_VIEW_TYPE_STATUS) {
|
||||||
|
rect.left = decorPaddingLeft;
|
||||||
|
} else {
|
||||||
|
rect.left = 0;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
itemDecoration.setDecorationEndOffset(1);
|
||||||
|
return itemDecoration;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getCurrentReadPositionTag() {
|
private String getCurrentReadPositionTag() {
|
||||||
final String tag = getReadPositionTagWithAccounts();
|
final String tag = getReadPositionTagWithAccounts();
|
||||||
if (tag == null) return null;
|
if (tag == null) return null;
|
||||||
|
|
|
@ -372,14 +372,30 @@ public abstract class AbsStatusesFragment extends AbsContentListRecyclerViewFrag
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
protected RecyclerView.ItemDecoration createItemDecoration(Context context, RecyclerView recyclerView, LinearLayoutManager layoutManager) {
|
protected RecyclerView.ItemDecoration createItemDecoration(Context context, final RecyclerView recyclerView, final LinearLayoutManager layoutManager) {
|
||||||
|
final ParcelableStatusesAdapter adapter = getAdapter();
|
||||||
final DividerItemDecoration itemDecoration = new DividerItemDecoration(context,
|
final DividerItemDecoration itemDecoration = new DividerItemDecoration(context,
|
||||||
((LinearLayoutManager) recyclerView.getLayoutManager()).getOrientation());
|
((LinearLayoutManager) recyclerView.getLayoutManager()).getOrientation());
|
||||||
final Resources res = context.getResources();
|
final Resources res = context.getResources();
|
||||||
if (getAdapter().isProfileImageEnabled()) {
|
if (adapter.isProfileImageEnabled()) {
|
||||||
final int decorPaddingLeft = res.getDimensionPixelSize(R.dimen.element_spacing_normal) * 2
|
final int decorPaddingLeft = res.getDimensionPixelSize(R.dimen.element_spacing_normal) * 2
|
||||||
+ res.getDimensionPixelSize(R.dimen.icon_size_status_profile_image);
|
+ res.getDimensionPixelSize(R.dimen.icon_size_status_profile_image);
|
||||||
itemDecoration.setPadding(decorPaddingLeft, 0, 0, 0);
|
itemDecoration.setPadding(new DividerItemDecoration.Padding() {
|
||||||
|
@Override
|
||||||
|
public boolean get(int position, Rect rect) {
|
||||||
|
final int itemViewType = adapter.getItemViewType(position);
|
||||||
|
boolean nextItemIsStatus = false;
|
||||||
|
if (position < adapter.getItemCount() - 1) {
|
||||||
|
nextItemIsStatus = adapter.getItemViewType(position + 1) == ParcelableStatusesAdapter.ITEM_VIEW_TYPE_STATUS;
|
||||||
|
}
|
||||||
|
if (nextItemIsStatus && itemViewType == ParcelableStatusesAdapter.ITEM_VIEW_TYPE_STATUS) {
|
||||||
|
rect.left = decorPaddingLeft;
|
||||||
|
} else {
|
||||||
|
rect.left = 0;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
itemDecoration.setDecorationEndOffset(1);
|
itemDecoration.setDecorationEndOffset(1);
|
||||||
return itemDecoration;
|
return itemDecoration;
|
||||||
|
|
Loading…
Reference in New Issue