Skip to content

Commit

Permalink
removing closed source library for f-droid variant
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Jan 4, 2016
1 parent c2f7ecc commit 6ff6f38
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 15 deletions.
16 changes: 3 additions & 13 deletions twidere/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.21.2'
}
}
import fr.avianey.androidsvgdrawable.gradle.SvgDrawableTask

import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'androidsvgdrawable'

Expand Down Expand Up @@ -119,6 +109,9 @@ dependencies {
compile 'com.j256.simplemagic:simplemagic:1.6'
googleCompile 'com.google.android.gms:play-services-maps:8.4.0'
googleCompile 'com.google.maps.android:android-maps-utils:0.4'
googleCompile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
googleCompile ':YouTubeAndroidPlayerApi:1.2.2@jar'
fdroidCompile 'org.osmdroid:osmdroid-android:5.0.1'
debugCompile 'com.facebook.stetho:stetho:1.2.0'
Expand All @@ -130,9 +123,6 @@ dependencies {
compile fileTree(dir: 'libs/main', include: ['*.jar'])
provided 'javax.annotation:jsr250-api:1.0'
// googleCompile fileTree(dir: 'libs/google', include: ['*.jar'])
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
}

task svgToDrawable(type: SvgDrawableTask) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 Mariotaku Lee <[email protected]>
*
* 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.app.Application;
import android.support.annotation.Nullable;
import android.util.Log;

import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;

/**
* Created by mariotaku on 15/7/8.
*/
public class TwidereBugReporter extends BugReporter implements Constants {

@Override
protected void logImpl(@Nullable String message, @Nullable Throwable throwable) {
if (BuildConfig.DEBUG) {
Log.d(LOGTAG, message, throwable);
}
}

@Override
protected void errorImpl(@Nullable String message, @Nullable Throwable throwable) {
if (throwable == null && message == null) {
throw new NullPointerException("Message and Throwable can't be both null");
}
if (message != null) {
if (BuildConfig.DEBUG) {
Log.w(LOGTAG, message, throwable);
}
return;
}
if (BuildConfig.DEBUG) {
Log.w(LOGTAG, throwable);
}
}

@Override
protected void initImpl(final Application application) {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1361,10 +1361,17 @@ private static class StatusAdapter extends BaseRecyclerViewAdapter<ViewHolder> i
private static final int ITEM_IDX_REPLY_ERROR = 6;
private static final int ITEM_IDX_SPACE = 7;
private static final int ITEM_TYPES_SUM = 8;


private final StatusFragment mFragment;
private final LayoutInflater mInflater;
private final MediaLoadingHandler mMediaLoadingHandler;
private final TwidereLinkify mTwidereLinkify;

private StatusAdapterListener mStatusAdapterListener;
private RecyclerView mRecyclerView;
private DetailStatusViewHolder mStatusViewHolder;

private final int[] mItemCounts;

private final boolean mNameFirst;
Expand All @@ -1388,9 +1395,8 @@ private static class StatusAdapter extends BaseRecyclerViewAdapter<ViewHolder> i
private TranslationResult mTranslationResult;
private StatusActivity mStatusActivity;
private ParcelableCredentials mStatusAccount;

private List<ParcelableStatus> mData;
private StatusAdapterListener mStatusAdapterListener;
private RecyclerView mRecyclerView;
private CharSequence mReplyError, mConversationError;
private boolean mRepliesLoading, mConversationsLoading;

Expand Down Expand Up @@ -1650,6 +1656,9 @@ public void setLoadMoreSupported(boolean supported) {
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
switch (viewType) {
case VIEW_TYPE_DETAIL_STATUS: {
if (mStatusViewHolder != null) {
return mStatusViewHolder;
}
final View view;
if (mIsCompact) {
view = mInflater.inflate(R.layout.header_status_compact, parent, false);
Expand Down Expand Up @@ -1736,6 +1745,23 @@ public void onBindViewHolder(ViewHolder holder, int position) {
}
}

@Override
public void onViewDetachedFromWindow(ViewHolder holder) {
if (holder instanceof DetailStatusViewHolder) {
mStatusViewHolder = (DetailStatusViewHolder) holder;
}
super.onViewDetachedFromWindow(holder);
}

@Override
public void onViewAttachedToWindow(ViewHolder holder) {
if (holder == mStatusViewHolder) {
mStatusViewHolder = null;
}
super.onViewAttachedToWindow(holder);
}


private TranslationResult getTranslationResult() {
return mTranslationResult;
}
Expand Down

0 comments on commit 6ff6f38

Please sign in to comment.