removed SuperToast library

This commit is contained in:
Mariotaku Lee 2016-05-17 12:51:35 +08:00
parent 2e0507d7a3
commit cddfd42668
4 changed files with 22 additions and 24 deletions

View File

@ -143,7 +143,6 @@ dependencies {
compile 'com.commonsware.cwac:layouts:0.4.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.github.johnpersano:supertoasts:1.3.4.1@aar'
compile 'com.github.mariotaku:MessageBubbleView:1.2'
compile 'com.github.mariotaku:DragSortListView:0.6.1'
compile 'com.github.uucky:ColorPicker-Android:0.9.7@aar'

View File

@ -97,9 +97,6 @@ import com.afollestad.appthemeengine.customizers.ATEToolbarCustomizer;
import com.afollestad.appthemeengine.util.ATEUtil;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.github.johnpersano.supertoasts.SuperToast;
import com.github.johnpersano.supertoasts.SuperToast.Duration;
import com.github.johnpersano.supertoasts.SuperToast.OnDismissListener;
import com.twitter.Extractor;
import org.apache.commons.lang3.ArrayUtils;
@ -209,6 +206,13 @@ public class ComposeActivity extends BaseActivity implements OnMenuItemClickList
private SupportMenuInflater mMenuInflater;
private ItemTouchHelper mItemTouchHelper;
private final Runnable mBackTimeoutRunnable = new Runnable() {
@Override
public void run() {
mNavigateBackPressed = false;
}
};
// Views
private RecyclerView mAttachedMediaPreview;
private ActionMenuView mMenuBar;
@ -892,14 +896,9 @@ public class ComposeActivity extends BaseActivity implements OnMenuItemClickList
if (ACTION_NAVIGATION_BACK.equals(action)) {
if (mEditText.length() == 0 && !mTextChanged) {
if (!mNavigateBackPressed) {
final SuperToast toast = SuperToast.create(this, getString(R.string.press_again_to_close), Duration.SHORT);
toast.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(View view) {
mNavigateBackPressed = false;
}
});
toast.show();
Toast.makeText(this, getString(R.string.press_again_to_close), Toast.LENGTH_SHORT).show();
mEditText.removeCallbacks(mBackTimeoutRunnable);
mEditText.postDelayed(mBackTimeoutRunnable, 2000);
} else {
onBackPressed();
}

View File

@ -66,10 +66,8 @@ import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.github.johnpersano.supertoasts.SuperToast;
import com.github.johnpersano.supertoasts.SuperToast.Duration;
import com.github.johnpersano.supertoasts.SuperToast.OnDismissListener;
import com.squareup.otto.Subscribe;
import org.mariotaku.sqliteqb.library.Columns.Column;
@ -199,6 +197,13 @@ public class MessagesConversationFragment extends BaseSupportFragment implements
private boolean mTextChanged, mQueryTextChanged;
private View mInputPanel;
private final Runnable mBackTimeoutRunnable = new Runnable() {
@Override
public void run() {
mNavigateBackPressed = false;
}
};
@Subscribe
public void notifyTaskStateChanged(TaskStateChangedEvent event) {
updateRefreshState();
@ -585,14 +590,9 @@ public class MessagesConversationFragment extends BaseSupportFragment implements
if (editText.length() == 0 && !textChanged) {
final FragmentActivity activity = getActivity();
if (!mNavigateBackPressed) {
final SuperToast toast = SuperToast.create(activity, getString(R.string.press_again_to_close), Duration.SHORT);
toast.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(View view) {
mNavigateBackPressed = false;
}
});
toast.show();
Toast.makeText(activity, R.string.press_again_to_close, Toast.LENGTH_SHORT).show();
editText.removeCallbacks(mBackTimeoutRunnable);
editText.postDelayed(mBackTimeoutRunnable, 2000);
mNavigateBackPressed = true;
} else {
activity.onBackPressed();

View File

@ -119,7 +119,7 @@
android:focusable="false"
android:singleLine="true"
android:textAppearance="?android:textAppearanceSmall"
android:textColor="@color/light_gray"
android:textColor="@color/material_grey"
tools:text="\@username"/>
</LinearLayout>