Skip to content

Commit

Permalink
ui fixes
Browse files Browse the repository at this point in the history
updated build tools version
  • Loading branch information
mariotaku committed Mar 11, 2015
1 parent 511b1ab commit 880deb1
Show file tree
Hide file tree
Showing 38 changed files with 505 additions and 538 deletions.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -21,4 +21,5 @@ allprojects {
jcenter()
mavenCentral()
}

}
Empty file added build.properties
Empty file.
22 changes: 22 additions & 0 deletions global.gradle
@@ -0,0 +1,22 @@
/*
* 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/>.
*/
android {
compileSdkVersion 22
buildToolsVersion '22'
}
4 changes: 1 addition & 3 deletions twidere.component.common/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
Expand Up @@ -196,10 +196,6 @@ public interface TwidereConstants extends SharedPreferenceConstants, IntentConst
public static final String TASK_TAG_GET_SENT_DIRECT_MESSAGES = "get_sent_direct_messages";
public static final String TASK_TAG_GET_RECEIVED_DIRECT_MESSAGES = "get_received_direct_messages";
public static final String TASK_TAG_GET_TRENDS = "get_trends";
public static final String TASK_TAG_STORE_HOME_TIMELINE = "store_home_tomeline";
public static final String TASK_TAG_STORE_MENTIONS = "store_mentions";
public static final String TASK_TAG_STORE_SENT_DIRECT_MESSAGES = "store_sent_direct_messages";
public static final String TASK_TAG_STORE_RECEIVED_DIRECT_MESSAGES = "store_received_direct_messages";
public static final String TASK_TAG_STORE_TRENDS = "store_trends";

public static final String SERVICE_COMMAND_REFRESH_ALL = "refresh_all";
Expand Down
4 changes: 1 addition & 3 deletions twidere.component.jsonserializer/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
4 changes: 1 addition & 3 deletions twidere.component.nyan/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
4 changes: 1 addition & 3 deletions twidere.component.querybuilder/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
4 changes: 1 addition & 3 deletions twidere.component.twitter4j.streaming/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
4 changes: 1 addition & 3 deletions twidere.component.twitter4j/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
4 changes: 1 addition & 3 deletions twidere.donate.nyanwp.wear/build.gradle
Expand Up @@ -18,12 +18,10 @@
*/

apply plugin: 'com.android.application'
apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "org.mariotaku.twidere.donate.nyanwp"
minSdkVersion 20
Expand Down
4 changes: 1 addition & 3 deletions twidere.donate.nyanwp/build.gradle
Expand Up @@ -18,12 +18,10 @@
*/

apply plugin: 'com.android.application'
apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "org.mariotaku.twidere.donate.nyanwp"
minSdkVersion 14
Expand Down
4 changes: 1 addition & 3 deletions twidere.extension.push.xiaomi/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.application'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "org.mariotaku.twidere.extension.push.xiaomi"
minSdkVersion 14
Expand Down
4 changes: 1 addition & 3 deletions twidere.extension.streaming/build.gradle
Expand Up @@ -18,12 +18,10 @@
*/

apply plugin: 'com.android.application'
apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "org.mariotaku.twidere.extension.streaming"
minSdkVersion 14
Expand Down
4 changes: 1 addition & 3 deletions twidere.extension.twitlonger/build.gradle
Expand Up @@ -18,12 +18,10 @@
*/

apply plugin: 'com.android.application'
apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "org.mariotaku.extension.twitlonger"
minSdkVersion 14
Expand Down
4 changes: 1 addition & 3 deletions twidere.library.extension/build.gradle
Expand Up @@ -18,11 +18,9 @@
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('global.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
Expand Down
24 changes: 21 additions & 3 deletions twidere.wear/build.gradle
@@ -1,10 +1,28 @@
/*
* 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/>.
*/

apply plugin: 'com.android.application'

apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "org.mariotaku.twidere"
minSdkVersion 20
Expand Down
5 changes: 2 additions & 3 deletions twidere/build.gradle
Expand Up @@ -2,16 +2,15 @@ import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
apply plugin: 'aar-link-sources'
apply from: rootProject.file('global.gradle')
apply from: rootProject.file('signing.gradle')

android {
compileSdkVersion 21
buildToolsVersion '21.1.2'

defaultConfig {
applicationId "org.mariotaku.twidere"
minSdkVersion 14
targetSdkVersion 21
targetSdkVersion 22
versionCode 99
versionName "0.3.0"
multiDexEnabled true
Expand Down
Expand Up @@ -1561,7 +1561,6 @@ public void onActivityCreated(final Bundle savedInstanceState) {
true, nameFirst, nicknameOnly, profileImageStyle, mediaPreviewStyle, status, null);
mStatusContainer.findViewById(R.id.item_menu).setVisibility(View.GONE);
mStatusContainer.findViewById(R.id.action_buttons).setVisibility(View.GONE);
mStatusContainer.findViewById(R.id.reply_retweet_status).setVisibility(View.GONE);
}


Expand Down
Expand Up @@ -28,35 +28,75 @@
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.R;
import org.mariotaku.twidere.adapter.iface.IContentCardAdapter;
import org.mariotaku.twidere.app.TwidereApplication;
import org.mariotaku.twidere.provider.TwidereDataStore.DirectMessages.ConversationEntries;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.ImageLoaderWrapper;
import org.mariotaku.twidere.util.ImageLoadingHandler;
import org.mariotaku.twidere.util.MultiSelectManager;
import org.mariotaku.twidere.util.SharedPreferencesWrapper;
import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.view.holder.MessageEntryViewHolder;

import static org.mariotaku.twidere.TwidereConstants.SHARED_PREFERENCES_NAME;
import static org.mariotaku.twidere.constant.SharedPreferenceConstants.KEY_NICKNAME_ONLY;

public class MessageEntriesAdapter extends Adapter<ViewHolder> implements OnClickListener {
public class MessageEntriesAdapter extends Adapter<ViewHolder> implements Constants, IContentCardAdapter, OnClickListener {

private final Context mContext;
private final LayoutInflater mInflater;
private final ImageLoaderWrapper mImageLoader;
private final MultiSelectManager mMultiSelectManager;
private final boolean mNicknameOnly;
private final int mTextSize;
private final int mProfileImageStyle;
private final int mMediaPreviewStyle;
private Cursor mCursor;
private MessageEntriesAdapterListener mListener;

public Context getContext() {
return mContext;
}

@Override
public ImageLoadingHandler getImageLoadingHandler() {
return null;
}

@Override
public int getProfileImageStyle() {
return mProfileImageStyle;
}

@Override
public int getMediaPreviewStyle() {
return mMediaPreviewStyle;
}

@Override
public AsyncTwitterWrapper getTwitterWrapper() {
return null;
}

@Override
public float getTextSize() {
return mTextSize;
}

public ImageLoaderWrapper getImageLoader() {
return mImageLoader;
}

@Override
public boolean isGapItem(int position) {
return false;
}

@Override
public void onGapClick(ViewHolder holder, int position) {

}

public boolean isNicknameOnly() {
return mNicknameOnly;
}
Expand All @@ -74,6 +114,16 @@ public void onBindViewHolder(ViewHolder holder, int position) {
((MessageEntryViewHolder) holder).displayMessage(c);
}

@Override
public void onItemActionClick(ViewHolder holder, int id, int position) {

}

@Override
public void onItemMenuClick(ViewHolder holder, View menuView, int position) {

}

public void onMessageClick(int position) {
if (mListener == null) return;
mListener.onEntryClick(position, getEntry(position));
Expand All @@ -97,8 +147,12 @@ public MessageEntriesAdapter(final Context context) {
final TwidereApplication app = TwidereApplication.getInstance(context);
mMultiSelectManager = app.getMultiSelectManager();
mImageLoader = app.getImageLoaderWrapper();
final SharedPreferencesWrapper prefs = SharedPreferencesWrapper.getInstance(context, SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
mNicknameOnly = prefs.getBoolean(KEY_NICKNAME_ONLY, false);
final SharedPreferencesWrapper preferences = SharedPreferencesWrapper.getInstance(context,
SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
mProfileImageStyle = Utils.getProfileImageStyle(preferences.getString(KEY_PROFILE_IMAGE_STYLE, null));
mMediaPreviewStyle = Utils.getMediaPreviewStyle(preferences.getString(KEY_MEDIA_PREVIEW_STYLE, null));
mTextSize = preferences.getInt(KEY_TEXT_SIZE, context.getResources().getInteger(R.integer.default_text_size));
mNicknameOnly = preferences.getBoolean(KEY_NICKNAME_ONLY, false);
}

public static class DirectMessageEntry {
Expand Down
Expand Up @@ -41,7 +41,7 @@

public class TabsAdapter extends FragmentStatePagerAdapter implements TabProvider, TabListener, Constants {

private final ArrayList<TabSpec> mTabs = new ArrayList<TabSpec>();
private final ArrayList<TabSpec> mTabs = new ArrayList<>();

private final Context mContext;
private final PagerIndicator mIndicator;
Expand Down

0 comments on commit 880deb1

Please sign in to comment.