mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-07 23:38:40 +01:00
updated library version
This commit is contained in:
parent
86c77d4dd8
commit
7f063531b6
@ -4,12 +4,10 @@ apply plugin: 'com.github.ben-manes.versions'
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
|
||||||
maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' }
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.8'
|
classpath 'com.github.ben-manes:gradle-versions-plugin:0.9'
|
||||||
classpath 'com.android.tools.build:gradle:1.1.3'
|
classpath 'com.android.tools.build:gradle:1.2.1'
|
||||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
|
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
@ -19,7 +17,6 @@ buildscript {
|
|||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
|
||||||
|
@ -39,7 +39,7 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
apt 'com.bluelinelabs:logansquare-compiler:1.0.6'
|
apt 'com.bluelinelabs:logansquare-compiler:1.0.6'
|
||||||
compile 'com.bluelinelabs:logansquare:1.0.6'
|
compile 'com.bluelinelabs:logansquare:1.0.6'
|
||||||
compile 'com.android.support:support-annotations:22.1.0'
|
compile 'com.android.support:support-annotations:22.1.1'
|
||||||
compile 'org.apache.commons:commons-lang3:3.4'
|
compile 'org.apache.commons:commons-lang3:3.4'
|
||||||
compile project(':twidere.component.querybuilder')
|
compile project(':twidere.component.querybuilder')
|
||||||
compile project(':twidere.component.twitter4j')
|
compile project(':twidere.component.twitter4j')
|
||||||
|
@ -54,7 +54,6 @@ android {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
|
||||||
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
|
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
|
||||||
maven { url 'https://github.com/suckgamony/RapidDecoder/raw/master/repository' }
|
maven { url 'https://github.com/suckgamony/RapidDecoder/raw/master/repository' }
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
@ -79,11 +78,11 @@ dependencies {
|
|||||||
compile 'dnsjava:dnsjava:2.1.7'
|
compile 'dnsjava:dnsjava:2.1.7'
|
||||||
compile 'com.commonsware.cwac:merge:1.1.1'
|
compile 'com.commonsware.cwac:merge:1.1.1'
|
||||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.3'
|
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.3'
|
||||||
compile 'com.rengwuxian.materialedittext:library:2.0.3'
|
compile 'com.rengwuxian.materialedittext:library:2.1.3'
|
||||||
compile 'com.pnikosis:materialish-progress:1.5'
|
compile 'com.pnikosis:materialish-progress:1.5'
|
||||||
compile 'com.squareup.okhttp:okhttp:2.3.0'
|
compile 'com.squareup.okhttp:okhttp:2.3.0'
|
||||||
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.5'
|
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.6'
|
||||||
compile 'com.github.johnpersano:supertoasts:1.3.4@aar'
|
compile 'com.github.johnpersano:supertoasts:1.3.4.1@aar'
|
||||||
compile 'com.github.mariotaku:MessageBubbleView:1.0'
|
compile 'com.github.mariotaku:MessageBubbleView:1.0'
|
||||||
compile 'com.github.mariotaku:DragSortListView:0.6.1'
|
compile 'com.github.mariotaku:DragSortListView:0.6.1'
|
||||||
compile 'com.github.mariotaku:SlidingMenu:1.3'
|
compile 'com.github.mariotaku:SlidingMenu:1.3'
|
||||||
|
@ -69,7 +69,7 @@ public class CreateUserListDialogFragment extends BaseSupportDialogFragment impl
|
|||||||
mAccountId = bundle != null ? bundle.getLong(EXTRA_ACCOUNT_ID, -1) : -1;
|
mAccountId = bundle != null ? bundle.getLong(EXTRA_ACCOUNT_ID, -1) : -1;
|
||||||
final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
|
final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(wrapped);
|
final AlertDialog.Builder builder = new AlertDialog.Builder(wrapped);
|
||||||
final View view = LayoutInflater.from(wrapped).inflate(R.layout.edit_user_list_detail, null);
|
final View view = LayoutInflater.from(wrapped).inflate(R.layout.dialog_user_list_detail_editor, null);
|
||||||
builder.setView(view);
|
builder.setView(view);
|
||||||
mEditName = (EditText) view.findViewById(R.id.name);
|
mEditName = (EditText) view.findViewById(R.id.name);
|
||||||
mEditDescription = (EditText) view.findViewById(R.id.description);
|
mEditDescription = (EditText) view.findViewById(R.id.description);
|
||||||
|
@ -486,7 +486,7 @@ public class UserListFragment extends BaseSupportFragment implements OnClickList
|
|||||||
mIsPublic = bundle == null || bundle.getBoolean(EXTRA_IS_PUBLIC, true);
|
mIsPublic = bundle == null || bundle.getBoolean(EXTRA_IS_PUBLIC, true);
|
||||||
final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
|
final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(wrapped);
|
final AlertDialog.Builder builder = new AlertDialog.Builder(wrapped);
|
||||||
final View view = LayoutInflater.from(wrapped).inflate(R.layout.edit_user_list_detail, null);
|
final View view = LayoutInflater.from(wrapped).inflate(R.layout.dialog_user_list_detail_editor, null);
|
||||||
builder.setView(view);
|
builder.setView(view);
|
||||||
mEditName = (EditText) view.findViewById(R.id.name);
|
mEditName = (EditText) view.findViewById(R.id.name);
|
||||||
mEditDescription = (EditText) view.findViewById(R.id.description);
|
mEditDescription = (EditText) view.findViewById(R.id.description);
|
||||||
|
@ -42,10 +42,12 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.rengwuxian.materialedittext.MaterialEditText;
|
||||||
|
import com.twitter.Validator;
|
||||||
|
|
||||||
import org.mariotaku.twidere.R;
|
import org.mariotaku.twidere.R;
|
||||||
import org.mariotaku.twidere.activity.support.ColorPickerDialogActivity;
|
import org.mariotaku.twidere.activity.support.ColorPickerDialogActivity;
|
||||||
import org.mariotaku.twidere.activity.support.ImagePickerActivity;
|
import org.mariotaku.twidere.activity.support.ImagePickerActivity;
|
||||||
@ -60,6 +62,7 @@ import org.mariotaku.twidere.util.AsyncTwitterWrapper.UpdateProfileImageTask;
|
|||||||
import org.mariotaku.twidere.util.KeyboardShortcutsHandler;
|
import org.mariotaku.twidere.util.KeyboardShortcutsHandler;
|
||||||
import org.mariotaku.twidere.util.MediaLoaderWrapper;
|
import org.mariotaku.twidere.util.MediaLoaderWrapper;
|
||||||
import org.mariotaku.twidere.util.ParseUtils;
|
import org.mariotaku.twidere.util.ParseUtils;
|
||||||
|
import org.mariotaku.twidere.util.TwitterValidatorMETLengthChecker;
|
||||||
import org.mariotaku.twidere.util.TwitterWrapper;
|
import org.mariotaku.twidere.util.TwitterWrapper;
|
||||||
import org.mariotaku.twidere.util.Utils;
|
import org.mariotaku.twidere.util.Utils;
|
||||||
import org.mariotaku.twidere.view.ForegroundColorView;
|
import org.mariotaku.twidere.view.ForegroundColorView;
|
||||||
@ -82,12 +85,13 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
|
|||||||
private static final int REQUEST_UPLOAD_PROFILE_BANNER_IMAGE = 2;
|
private static final int REQUEST_UPLOAD_PROFILE_BANNER_IMAGE = 2;
|
||||||
private static final int REQUEST_PICK_LINK_COLOR = 3;
|
private static final int REQUEST_PICK_LINK_COLOR = 3;
|
||||||
private static final int REQUEST_PICK_BACKGROUND_COLOR = 4;
|
private static final int REQUEST_PICK_BACKGROUND_COLOR = 4;
|
||||||
|
|
||||||
private MediaLoaderWrapper mLazyImageLoader;
|
private MediaLoaderWrapper mLazyImageLoader;
|
||||||
private AsyncTaskManager mAsyncTaskManager;
|
private AsyncTaskManager mAsyncTaskManager;
|
||||||
private AsyncTask<Object, Object, ?> mTask;
|
private AsyncTask<Object, Object, ?> mTask;
|
||||||
private ImageView mProfileImageView;
|
private ImageView mProfileImageView;
|
||||||
private ImageView mProfileBannerView;
|
private ImageView mProfileBannerView;
|
||||||
private EditText mEditName, mEditDescription, mEditLocation, mEditUrl;
|
private MaterialEditText mEditName, mEditDescription, mEditLocation, mEditUrl;
|
||||||
private View mProgressContainer, mEditProfileContent;
|
private View mProgressContainer, mEditProfileContent;
|
||||||
private View mProfileImageCamera, mProfileImageGallery;
|
private View mProfileImageCamera, mProfileImageGallery;
|
||||||
private View mProfileBannerGallery, mProfileBannerRemove;
|
private View mProfileBannerGallery, mProfileBannerRemove;
|
||||||
@ -223,11 +227,14 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setOverrideExitAniamtion(false);
|
final TwitterValidatorMETLengthChecker lengthChecker = new TwitterValidatorMETLengthChecker(new Validator());
|
||||||
mEditName.addTextChangedListener(this);
|
mEditName.addTextChangedListener(this);
|
||||||
mEditDescription.addTextChangedListener(this);
|
mEditDescription.addTextChangedListener(this);
|
||||||
mEditLocation.addTextChangedListener(this);
|
mEditLocation.addTextChangedListener(this);
|
||||||
mEditUrl.addTextChangedListener(this);
|
mEditUrl.addTextChangedListener(this);
|
||||||
|
|
||||||
|
mEditDescription.setLengthChecker(lengthChecker);
|
||||||
|
|
||||||
mProfileImageView.setOnClickListener(this);
|
mProfileImageView.setOnClickListener(this);
|
||||||
mProfileBannerView.setOnClickListener(this);
|
mProfileBannerView.setOnClickListener(this);
|
||||||
mProfileImageCamera.setOnClickListener(this);
|
mProfileImageCamera.setOnClickListener(this);
|
||||||
@ -276,10 +283,10 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
|
|||||||
mEditProfileContent = view.findViewById(R.id.edit_profile_content);
|
mEditProfileContent = view.findViewById(R.id.edit_profile_content);
|
||||||
mProfileBannerView = (ImageView) view.findViewById(R.id.profile_banner);
|
mProfileBannerView = (ImageView) view.findViewById(R.id.profile_banner);
|
||||||
mProfileImageView = (ImageView) view.findViewById(R.id.profile_image);
|
mProfileImageView = (ImageView) view.findViewById(R.id.profile_image);
|
||||||
mEditName = (EditText) view.findViewById(R.id.name);
|
mEditName = (MaterialEditText) view.findViewById(R.id.name);
|
||||||
mEditDescription = (EditText) view.findViewById(R.id.description);
|
mEditDescription = (MaterialEditText) view.findViewById(R.id.description);
|
||||||
mEditLocation = (EditText) view.findViewById(R.id.location);
|
mEditLocation = (MaterialEditText) view.findViewById(R.id.location);
|
||||||
mEditUrl = (EditText) view.findViewById(R.id.url);
|
mEditUrl = (MaterialEditText) view.findViewById(R.id.url);
|
||||||
mProfileImageCamera = view.findViewById(R.id.profile_image_camera);
|
mProfileImageCamera = view.findViewById(R.id.profile_image_camera);
|
||||||
mProfileImageGallery = view.findViewById(R.id.profile_image_gallery);
|
mProfileImageGallery = view.findViewById(R.id.profile_image_gallery);
|
||||||
mProfileBannerGallery = view.findViewById(R.id.profile_banner_gallery);
|
mProfileBannerGallery = view.findViewById(R.id.profile_banner_gallery);
|
||||||
|
@ -1070,15 +1070,10 @@ public class ThemeUtils implements Constants {
|
|||||||
|
|
||||||
public static void setActionBarOverflowColor(ActionMenuPresenter presenter, int itemColor) {
|
public static void setActionBarOverflowColor(ActionMenuPresenter presenter, int itemColor) {
|
||||||
if (presenter == null) return;
|
if (presenter == null) return;
|
||||||
View overflowView = null;
|
final View view = (View) Utils.findFieldOfTypes(presenter, ActionMenuPresenter.class,
|
||||||
View view = (View) Utils.findFieldOfTypes(presenter, ActionMenuPresenter.class, ActionMenuView.ActionMenuChildView.class, View.class);
|
ActionMenuView.ActionMenuChildView.class, View.class);
|
||||||
if (view == null) return;
|
if (!(view instanceof ImageView)) return;
|
||||||
final ActionMenuView.LayoutParams lp = (ActionMenuView.LayoutParams) view.getLayoutParams();
|
((ImageView) view).setColorFilter(itemColor, Mode.SRC_ATOP);
|
||||||
if (lp.isOverflowButton) {
|
|
||||||
overflowView = view;
|
|
||||||
}
|
|
||||||
if (!(overflowView instanceof ImageView)) return;
|
|
||||||
((ImageView) overflowView).setColorFilter(itemColor, Mode.SRC_ATOP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setActionBarOverflowColor(ActionMenuView actionMenuView, int itemColor) {
|
public static void setActionBarOverflowColor(ActionMenuView actionMenuView, int itemColor) {
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Twidere - Twitter client for Android
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.mariotaku.twidere.util;
|
||||||
|
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.rengwuxian.materialedittext.validation.METLengthChecker;
|
||||||
|
import com.twitter.Validator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mariotaku on 15/4/29.
|
||||||
|
*/
|
||||||
|
public class TwitterValidatorMETLengthChecker extends METLengthChecker {
|
||||||
|
private Validator mValidator;
|
||||||
|
|
||||||
|
public TwitterValidatorMETLengthChecker(@NonNull Validator validator) {
|
||||||
|
mValidator = validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLength(CharSequence charSequence) {
|
||||||
|
return mValidator.getTweetLength(String.valueOf(charSequence));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -4235,15 +4235,19 @@ public final class Utils implements Constants, TwitterConstants {
|
|||||||
public static <T> Object findFieldOfTypes(T obj, Class<? extends T> cls, Class<?>... checkTypes) {
|
public static <T> Object findFieldOfTypes(T obj, Class<? extends T> cls, Class<?>... checkTypes) {
|
||||||
labelField:
|
labelField:
|
||||||
for (Field field : cls.getDeclaredFields()) {
|
for (Field field : cls.getDeclaredFields()) {
|
||||||
final Class<?> type = field.getType();
|
|
||||||
View view = null;
|
|
||||||
for (Class<?> checkType : checkTypes) {
|
|
||||||
if (!checkType.isAssignableFrom(type)) continue labelField;
|
|
||||||
}
|
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
|
final Object fieldObj;
|
||||||
try {
|
try {
|
||||||
return field.get(obj);
|
fieldObj = field.get(obj);
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (fieldObj != null) {
|
||||||
|
final Class<?> type = fieldObj.getClass();
|
||||||
|
for (Class<?> checkType : checkTypes) {
|
||||||
|
if (!checkType.isAssignableFrom(type)) continue labelField;
|
||||||
|
}
|
||||||
|
return fieldObj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user