1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-31 17:04:59 +01:00

updated library version

This commit is contained in:
Mariotaku Lee 2015-04-29 00:54:42 +08:00
parent 86c77d4dd8
commit 7f063531b6
11 changed files with 79 additions and 35 deletions

View File

@ -4,12 +4,10 @@ apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' }
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.8'
classpath 'com.android.tools.build:gradle:1.1.3'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.9'
classpath 'com.android.tools.build:gradle:1.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -19,7 +17,6 @@ buildscript {
allprojects {
repositories {
jcenter()
mavenCentral()
}
}

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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

View File

@ -39,7 +39,7 @@ android {
dependencies {
apt 'com.bluelinelabs:logansquare-compiler: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 project(':twidere.component.querybuilder')
compile project(':twidere.component.twitter4j')

View File

@ -54,7 +54,6 @@ android {
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
maven { url 'https://github.com/suckgamony/RapidDecoder/raw/master/repository' }
maven { url "https://jitpack.io" }
@ -79,11 +78,11 @@ dependencies {
compile 'dnsjava:dnsjava:2.1.7'
compile 'com.commonsware.cwac:merge:1.1.1'
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.squareup.okhttp:okhttp:2.3.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.5'
compile 'com.github.johnpersano:supertoasts:1.3.4@aar'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.6'
compile 'com.github.johnpersano:supertoasts:1.3.4.1@aar'
compile 'com.github.mariotaku:MessageBubbleView:1.0'
compile 'com.github.mariotaku:DragSortListView:0.6.1'
compile 'com.github.mariotaku:SlidingMenu:1.3'

View File

@ -69,7 +69,7 @@ public class CreateUserListDialogFragment extends BaseSupportDialogFragment impl
mAccountId = bundle != null ? bundle.getLong(EXTRA_ACCOUNT_ID, -1) : -1;
final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
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);
mEditName = (EditText) view.findViewById(R.id.name);
mEditDescription = (EditText) view.findViewById(R.id.description);

View File

@ -486,7 +486,7 @@ public class UserListFragment extends BaseSupportFragment implements OnClickList
mIsPublic = bundle == null || bundle.getBoolean(EXTRA_IS_PUBLIC, true);
final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
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);
mEditName = (EditText) view.findViewById(R.id.name);
mEditDescription = (EditText) view.findViewById(R.id.description);

View File

@ -42,10 +42,12 @@ import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.rengwuxian.materialedittext.MaterialEditText;
import com.twitter.Validator;
import org.mariotaku.twidere.R;
import org.mariotaku.twidere.activity.support.ColorPickerDialogActivity;
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.MediaLoaderWrapper;
import org.mariotaku.twidere.util.ParseUtils;
import org.mariotaku.twidere.util.TwitterValidatorMETLengthChecker;
import org.mariotaku.twidere.util.TwitterWrapper;
import org.mariotaku.twidere.util.Utils;
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_PICK_LINK_COLOR = 3;
private static final int REQUEST_PICK_BACKGROUND_COLOR = 4;
private MediaLoaderWrapper mLazyImageLoader;
private AsyncTaskManager mAsyncTaskManager;
private AsyncTask<Object, Object, ?> mTask;
private ImageView mProfileImageView;
private ImageView mProfileBannerView;
private EditText mEditName, mEditDescription, mEditLocation, mEditUrl;
private MaterialEditText mEditName, mEditDescription, mEditLocation, mEditUrl;
private View mProgressContainer, mEditProfileContent;
private View mProfileImageCamera, mProfileImageGallery;
private View mProfileBannerGallery, mProfileBannerRemove;
@ -223,11 +227,14 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
return;
}
// setOverrideExitAniamtion(false);
final TwitterValidatorMETLengthChecker lengthChecker = new TwitterValidatorMETLengthChecker(new Validator());
mEditName.addTextChangedListener(this);
mEditDescription.addTextChangedListener(this);
mEditLocation.addTextChangedListener(this);
mEditUrl.addTextChangedListener(this);
mEditDescription.setLengthChecker(lengthChecker);
mProfileImageView.setOnClickListener(this);
mProfileBannerView.setOnClickListener(this);
mProfileImageCamera.setOnClickListener(this);
@ -276,10 +283,10 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
mEditProfileContent = view.findViewById(R.id.edit_profile_content);
mProfileBannerView = (ImageView) view.findViewById(R.id.profile_banner);
mProfileImageView = (ImageView) view.findViewById(R.id.profile_image);
mEditName = (EditText) view.findViewById(R.id.name);
mEditDescription = (EditText) view.findViewById(R.id.description);
mEditLocation = (EditText) view.findViewById(R.id.location);
mEditUrl = (EditText) view.findViewById(R.id.url);
mEditName = (MaterialEditText) view.findViewById(R.id.name);
mEditDescription = (MaterialEditText) view.findViewById(R.id.description);
mEditLocation = (MaterialEditText) view.findViewById(R.id.location);
mEditUrl = (MaterialEditText) view.findViewById(R.id.url);
mProfileImageCamera = view.findViewById(R.id.profile_image_camera);
mProfileImageGallery = view.findViewById(R.id.profile_image_gallery);
mProfileBannerGallery = view.findViewById(R.id.profile_banner_gallery);

View File

@ -1070,15 +1070,10 @@ public class ThemeUtils implements Constants {
public static void setActionBarOverflowColor(ActionMenuPresenter presenter, int itemColor) {
if (presenter == null) return;
View overflowView = null;
View view = (View) Utils.findFieldOfTypes(presenter, ActionMenuPresenter.class, ActionMenuView.ActionMenuChildView.class, View.class);
if (view == null) return;
final ActionMenuView.LayoutParams lp = (ActionMenuView.LayoutParams) view.getLayoutParams();
if (lp.isOverflowButton) {
overflowView = view;
}
if (!(overflowView instanceof ImageView)) return;
((ImageView) overflowView).setColorFilter(itemColor, Mode.SRC_ATOP);
final View view = (View) Utils.findFieldOfTypes(presenter, ActionMenuPresenter.class,
ActionMenuView.ActionMenuChildView.class, View.class);
if (!(view instanceof ImageView)) return;
((ImageView) view).setColorFilter(itemColor, Mode.SRC_ATOP);
}
public static void setActionBarOverflowColor(ActionMenuView actionMenuView, int itemColor) {

View File

@ -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));
}
}

View File

@ -4235,15 +4235,19 @@ public final class Utils implements Constants, TwitterConstants {
public static <T> Object findFieldOfTypes(T obj, Class<? extends T> cls, Class<?>... checkTypes) {
labelField:
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);
final Object fieldObj;
try {
return field.get(obj);
fieldObj = field.get(obj);
} 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;