Remove AssertUtils

This commit is contained in:
seven332 committed 2016-06-08 20:31:47 +08:00
1 parent c80445e43a
commit f3c90d46fd
21 files changed
+90 -69

No files matched your search

@@ -32,11 +32,12 @@ import com.hippo.ehviewer.client.data.FavListUrlBuilder;
import com.hippo.ehviewer.ui.CommonOperations;
import com.hippo.glgallery.GalleryView;
import com.hippo.unifile.UniFile;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.MathUtils;
import com.hippo.yorozuya.NumberUtils;
import junit.framework.Assert;
import java.io.File;
public class Settings {
@@ -723,7 +724,7 @@ public class Settings {
}
public static void putFavCat(String[] value) {
AssertUtils.assertEquals(10, value.length);
Assert.assertEquals(10, value.length);
sSettingsPre.edit()
.putString(KEY_FAV_CAT_0, value[0])
.putString(KEY_FAV_CAT_1, value[1])
@@ -45,7 +45,8 @@ import com.hippo.ehviewer.client.parser.TorrentParser;
import com.hippo.ehviewer.client.parser.VoteCommentParser;
import com.hippo.ehviewer.client.parser.WhatsHotParser;
import com.hippo.network.StatusCodeException;
import com.hippo.yorozuya.AssertUtils;
import junit.framework.Assert;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -501,7 +502,7 @@ public class EhEngine {
public static Void addFavoritesRange(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long[] gidArray, String[] tokenArray, int dstCat) throws Exception {
AssertUtils.assertEqualsEx(gidArray.length, tokenArray.length);
Assert.assertEquals(gidArray.length, tokenArray.length);
for (int i = 0, n = gidArray.length; i < n; i++) {
addFavorites(task, okHttpClient, gidArray[i], tokenArray[i], dstCat, null);
}
@@ -22,7 +22,8 @@ import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.ehviewer.client.exception.EhException;
import com.hippo.ehviewer.client.exception.ParseException;
import com.hippo.util.JsoupUtils;
import com.hippo.yorozuya.AssertUtils;
import junit.framework.Assert;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@@ -53,7 +54,7 @@ public class FavoritesParser {
//noinspection ConstantConditions
Elements fps = ido.getElementsByClass("fp");
// Last one is "fp fps"
AssertUtils.assertEqualsEx(11, fps.size());
Assert.assertEquals(11, fps.size());
for (int i = 0; i < 10; i++) {
Element fp = fps.get(i);
@@ -36,9 +36,10 @@ import com.hippo.ehviewer.R;
import com.hippo.ehviewer.client.EhCookieStore;
import com.hippo.ehviewer.client.EhUrl;
import com.hippo.ehviewer.client.EhUtils;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import okhttp3.Cookie;
public class CookieSignInScene extends SolidScene implements EditText.OnEditorActionListener,
@@ -70,10 +71,10 @@ public class CookieSignInScene extends SolidScene implements EditText.OnEditorAc
View view = inflater.inflate(R.layout.scene_cookie_sign_in, container, false);
mIpbMemberIdLayout = (TextInputLayout) ViewUtils.$$(view, R.id.ipb_member_id_layout);
mIpbMemberId = mIpbMemberIdLayout.getEditText();
AssertUtils.assertNotNull(mIpbMemberId);
Assert.assertNotNull(mIpbMemberId);
mIpbPassHashLayout = (TextInputLayout) ViewUtils.$$(view, R.id.ipb_pass_hash_layout);
mIpbPassHash = mIpbPassHashLayout.getEditText();
AssertUtils.assertNotNull(mIpbPassHash);
Assert.assertNotNull(mIpbPassHash);
mOk = ViewUtils.$$(view, R.id.ok);
mIpbPassHash.setOnEditorActionListener(this);
@@ -82,7 +83,7 @@ public class CookieSignInScene extends SolidScene implements EditText.OnEditorAc
// Try to get old version cookie info
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
SharedPreferences sharedPreferences = context.getSharedPreferences("eh_info", 0);
String ipbMemberId = sharedPreferences.getString("ipb_member_id", null);
String ipbPassHash = sharedPreferences.getString("ipb_pass_hash", null);
@@ -53,9 +53,10 @@ import com.hippo.ehviewer.R;
import com.hippo.ehviewer.dao.DownloadLabel;
import com.hippo.util.DrawableManager;
import com.hippo.view.ViewTransition;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.util.List;
public class DownloadLabelsScene extends ToolbarScene {
@@ -100,7 +101,7 @@ public class DownloadLabelsScene extends ToolbarScene {
mViewTransition = new ViewTransition(mRecyclerView, tip);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_label);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
tip.setCompoundDrawables(null, drawable, null, null);
@@ -340,7 +341,7 @@ public class DownloadLabelsScene extends ToolbarScene {
public LabelAdapter() {
mInflater = getLayoutInflater2();
AssertUtils.assertNotNull(mInflater);
Assert.assertNotNull(mInflater);
}
@Override
@@ -88,7 +88,6 @@ import com.hippo.view.ViewTransition;
import com.hippo.widget.FabLayout;
import com.hippo.widget.LoadImageView;
import com.hippo.widget.recyclerview.AutoStaggeredGridLayoutManager;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.IOUtils;
import com.hippo.yorozuya.ObjectUtils;
@@ -96,6 +95,8 @@ import com.hippo.yorozuya.ResourcesUtils;
import com.hippo.yorozuya.ViewUtils;
import com.hippo.yorozuya.collect.LongList;
import junit.framework.Assert;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -193,7 +194,7 @@ public class DownloadsScene extends ToolbarScene
super.onCreate(savedInstanceState);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mDownloadManager = EhApplication.getDownloadManager(context);
mDownloadManager.addDownloadInfoListener(this);
@@ -286,7 +287,7 @@ public class DownloadsScene extends ToolbarScene
mViewTransition = new ViewTransition(content, tip);
Context context = getContext2();
AssertUtils.assertNotNull(content);
Assert.assertNotNull(content);
Resources resources = context.getResources();
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_download);
@@ -508,7 +509,7 @@ public class DownloadsScene extends ToolbarScene
View view = inflater.inflate(R.layout.drawer_list, container, false);
final Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setTitle(R.string.download_labels);
@@ -1123,7 +1124,7 @@ public class DownloadsScene extends ToolbarScene
public DownloadAdapter() {
mInflater = getLayoutInflater2();
AssertUtils.assertNotNull(mInflater);
Assert.assertNotNull(mInflater);
}
@Override
@@ -80,13 +80,14 @@ import com.hippo.util.DrawableManager;
import com.hippo.widget.ContentLayout;
import com.hippo.widget.FabLayout;
import com.hippo.widget.SearchBarMover;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.LayoutUtils;
import com.hippo.yorozuya.ObjectUtils;
import com.hippo.yorozuya.ResourcesUtils;
import com.hippo.yorozuya.SimpleHandler;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -177,7 +178,7 @@ public class FavoritesScene extends BaseScene implements
super.onCreate(savedInstanceState);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mClient = EhApplication.getEhClient(context);
mFavCatArray = Settings.getFavCat();
@@ -242,7 +243,7 @@ public class FavoritesScene extends BaseScene implements
mFabLayout = (FabLayout) ViewUtils.$$(view, R.id.fab_layout);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Resources resources = context.getResources();
int paddingTopSB = resources.getDimensionPixelOffset(R.dimen.gallery_padding_top_search_bar);
@@ -499,7 +500,7 @@ public class FavoritesScene extends BaseScene implements
ListView listView = (ListView) view.findViewById(R.id.list_view);
final Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
toolbar.setTitle(R.string.collections);
toolbar.inflateMenu(R.menu.drawer_favorites);
@@ -76,7 +76,6 @@ import com.hippo.widget.FabLayout;
import com.hippo.widget.LinkifyTextView;
import com.hippo.widget.ObservedTextView;
import com.hippo.yorozuya.AnimationUtils;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.LayoutUtils;
import com.hippo.yorozuya.ResourcesUtils;
import com.hippo.yorozuya.SimpleAnimatorListener;
@@ -84,6 +83,8 @@ import com.hippo.yorozuya.StringUtils;
import com.hippo.yorozuya.ViewUtils;
import com.hippo.yorozuya.collect.IntList;
import junit.framework.Assert;
import java.util.ArrayList;
import java.util.List;
@@ -190,7 +191,7 @@ public final class GalleryCommentsScene extends ToolbarScene
mFab = (FloatingActionButton) ViewUtils.$$(view, R.id.fab);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Resources resources = context.getResources();
int paddingBottomFab = resources.getDimensionPixelOffset(R.dimen.gallery_padding_bottom_fab);
@@ -617,7 +618,7 @@ public final class GalleryCommentsScene extends ToolbarScene
public CommentAdapter() {
mInflater = getLayoutInflater2();
AssertUtils.assertNotNull(mInflater);
Assert.assertNotNull(mInflater);
}
@Override
@@ -81,6 +81,7 @@ import com.hippo.ehviewer.ui.CommonOperations;
import com.hippo.ehviewer.ui.GalleryActivity;
import com.hippo.ehviewer.ui.MainActivity;
import com.hippo.ehviewer.ui.annotation.WholeLifeCircle;
import com.hippo.ehviewer.widget.GalleryRatingBar;
import com.hippo.reveal.ViewAnimationUtils;
import com.hippo.ripple.Ripple;
import com.hippo.scene.Announcer;
@@ -98,13 +99,13 @@ import com.hippo.widget.AutoWrapLayout;
import com.hippo.widget.LoadImageView;
import com.hippo.widget.ObservedTextView;
import com.hippo.widget.ProgressView;
import com.hippo.ehviewer.widget.GalleryRatingBar;
import com.hippo.widget.SimpleGridAutoSpanLayout;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.IOUtils;
import com.hippo.yorozuya.SimpleHandler;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -400,7 +401,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
long gid = getGid();
if (gid != -1) {
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mDownloadState = EhApplication.getDownloadManager(context).getDownloadState(gid);
} else {
mDownloadState = DownloadInfo.STATE_INVALID;
@@ -415,7 +416,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mViewTransition = new ViewTransition(mainView, progressView, mTip);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_weird_face);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
@@ -531,7 +532,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
super.onDestroyView();
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
EhApplication.getDownloadManager(context).removeDownloadInfoListener(this);
mTip = null;
@@ -587,7 +588,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
private boolean prepareData() {
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
if (mGalleryDetail != null) {
return true;
@@ -770,7 +771,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
}
Resources resources = getResources2();
AssertUtils.assertNotNull(resources);
Assert.assertNotNull(resources);
mThumb.load(EhCacheKeyFactory.getThumbKey(gd.gid), gd.thumb);
mTitle.setText(EhUtils.getSuitableTitle(gd));
@@ -946,7 +947,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
private String getAllRatingText(float rating, int ratingCount) {
Resources resources = getResources2();
AssertUtils.assertNotNull(resources);
Assert.assertNotNull(resources);
return resources.getString(R.string.rating_text, getRatingText(rating, resources), rating, ratingCount);
}
@@ -969,7 +970,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
}
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
PopupMenu popup = new PopupMenu(context, mOtherActions, Gravity.TOP);
mPopupMenu = popup;
popup.getMenuInflater().inflate(R.menu.scene_gallery_detail, popup.getMenu());
@@ -37,10 +37,11 @@ import com.hippo.ehviewer.client.EhUrl;
import com.hippo.ehviewer.client.EhUtils;
import com.hippo.ehviewer.client.data.GalleryDetail;
import com.hippo.ripple.Ripple;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.LayoutUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.util.ArrayList;
public final class GalleryInfoScene extends ToolbarScene implements EasyRecyclerView.OnItemClickListener {
@@ -84,7 +85,7 @@ public final class GalleryInfoScene extends ToolbarScene implements EasyRecycler
}
Resources resources = getResources2();
AssertUtils.assertNotNull(resources);
Assert.assertNotNull(resources);
mKeys.add(resources.getString(R.string.header_key));
mValues.add(resources.getString(R.string.header_value));
mKeys.add(resources.getString(R.string.key_gid));
@@ -155,7 +156,7 @@ public final class GalleryInfoScene extends ToolbarScene implements EasyRecycler
View view = inflater.inflate(R.layout.scene_gallery_info, container, false);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mRecyclerView = (EasyRecyclerView) ViewUtils.$$(view, R.id.recycler_view);
InfoAdapter adapter = new InfoAdapter();
@@ -230,7 +231,7 @@ public final class GalleryInfoScene extends ToolbarScene implements EasyRecycler
public InfoAdapter() {
mInflater = getLayoutInflater2();
AssertUtils.assertNotNull(mInflater);
Assert.assertNotNull(mInflater);
}
@Override
@@ -88,12 +88,13 @@ import com.hippo.widget.ContentLayout;
import com.hippo.widget.FabLayout;
import com.hippo.widget.SearchBarMover;
import com.hippo.yorozuya.AnimationUtils;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.MathUtils;
import com.hippo.yorozuya.SimpleAnimatorListener;
import com.hippo.yorozuya.StringUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -256,7 +257,7 @@ public final class GalleryListScene extends BaseScene
super.onCreate(savedInstanceState);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mClient = EhApplication.getEhClient(context);
if (savedInstanceState == null) {
@@ -385,7 +386,7 @@ public final class GalleryListScene extends BaseScene
View view = inflater.inflate(R.layout.scene_gallery_list, container, false);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Resources resources = context.getResources();
mHideActionFabSlop = ViewConfiguration.get(context).getScaledTouchSlop();
@@ -632,7 +633,7 @@ public final class GalleryListScene extends BaseScene
final ListView listView = (ListView) ViewUtils.$$(view, R.id.list_view);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
final List<QuickSearch> list = EhDB.getAllQuickSearch();
final ArrayAdapter<QuickSearch> adapter = new ArrayAdapter<>(context, R.layout.item_simple_list, list);
@@ -53,10 +53,11 @@ import com.hippo.widget.ContentLayout;
import com.hippo.widget.LoadImageView;
import com.hippo.widget.Slider;
import com.hippo.widget.recyclerview.AutoGridLayoutManager;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.LayoutUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.util.ArrayList;
import java.util.Locale;
@@ -90,7 +91,7 @@ public class GalleryPreviewsScene extends ToolbarScene implements EasyRecyclerVi
super.onCreate(savedInstanceState);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mClient = EhApplication.getEhClient(context);
if (savedInstanceState == null) {
onInit();
@@ -137,7 +138,7 @@ public class GalleryPreviewsScene extends ToolbarScene implements EasyRecyclerVi
mRecyclerView = contentLayout.getRecyclerView();
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Resources resources = context.getResources();
mAdapter = new GalleryPreviewAdapter();
@@ -261,7 +262,7 @@ public class GalleryPreviewsScene extends ToolbarScene implements EasyRecyclerVi
public GalleryPreviewAdapter() {
mInflater = getLayoutInflater2();
AssertUtils.assertNotNull(mInflater);
Assert.assertNotNull(mInflater);
}
@Override
@@ -64,10 +64,11 @@ import com.hippo.util.DrawableManager;
import com.hippo.view.ViewTransition;
import com.hippo.widget.LoadImageView;
import com.hippo.widget.recyclerview.AutoStaggeredGridLayoutManager;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ResourcesUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import de.greenrobot.dao.query.LazyList;
public class HistoryScene extends ToolbarScene
@@ -103,7 +104,7 @@ public class HistoryScene extends ToolbarScene
mViewTransition = new ViewTransition(content, tip);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Resources resources = context.getResources();
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_history);
@@ -36,9 +36,10 @@ import com.hippo.scene.SceneFragment;
import com.hippo.util.DrawableManager;
import com.hippo.util.ExceptionUtils;
import com.hippo.view.ViewTransition;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
/**
* Only show a progress with jobs in background
*/
@@ -169,7 +170,7 @@ public final class ProgressScene extends BaseScene implements View.OnClickListen
mTip = (TextView) ViewUtils.$$(view, R.id.tip);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_weird_face);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
@@ -49,9 +49,10 @@ import com.hippo.ehviewer.R;
import com.hippo.ehviewer.dao.QuickSearch;
import com.hippo.util.DrawableManager;
import com.hippo.view.ViewTransition;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.util.List;
public final class QuickSearchScene extends ToolbarScene {
@@ -96,7 +97,7 @@ public final class QuickSearchScene extends ToolbarScene {
mViewTransition = new ViewTransition(mRecyclerView, tip);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_search);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
@@ -197,7 +198,7 @@ public final class QuickSearchScene extends ToolbarScene {
public QuickSearchAdapter() {
mInflater = getLayoutInflater2();
AssertUtils.assertNotNull(mInflater);
Assert.assertNotNull(mInflater);
}
@Override
@@ -31,10 +31,11 @@ import com.hippo.ehviewer.ui.MainActivity;
import com.hippo.hardware.ShakeDetector;
import com.hippo.widget.lockpattern.LockPatternUtils;
import com.hippo.widget.lockpattern.LockPatternView;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ObjectUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
import java.util.List;
public class SecurityScene extends SolidScene implements
@@ -63,7 +64,7 @@ public class SecurityScene extends SolidScene implements
super.onCreate(savedInstanceState);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
if (null != mSensorManager) {
mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
@@ -42,9 +42,10 @@ import com.hippo.ehviewer.client.parser.ProfileParser;
import com.hippo.ehviewer.ui.MainActivity;
import com.hippo.scene.Announcer;
import com.hippo.scene.SceneFragment;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.ViewUtils;
import junit.framework.Assert;
public final class SignInScene extends SolidScene implements EditText.OnEditorActionListener,
View.OnClickListener {
@@ -119,10 +120,10 @@ public final class SignInScene extends SolidScene implements EditText.OnEditorAc
mProgress = ViewUtils.$$(view, R.id.progress);
mUsernameLayout = (TextInputLayout) ViewUtils.$$(loginForm, R.id.username_layout);
mUsername = mUsernameLayout.getEditText();
AssertUtils.assertNotNull(mUsername);
Assert.assertNotNull(mUsername);
mPasswordLayout = (TextInputLayout) ViewUtils.$$(loginForm, R.id.password_layout);
mPassword = mPasswordLayout.getEditText();
AssertUtils.assertNotNull(mPassword);
Assert.assertNotNull(mPassword);
mRegister = ViewUtils.$$(loginForm, R.id.register);
mSignIn = ViewUtils.$$(loginForm, R.id.sign_in);
mSignInViaWebView = (TextView) ViewUtils.$$(loginForm, R.id.sign_in_via_webview);
@@ -142,7 +143,7 @@ public final class SignInScene extends SolidScene implements EditText.OnEditorAc
mSkipSigningIn.setOnClickListener(this);
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
EhApplication application = (EhApplication) context.getApplicationContext();
if (application.containGlobalStuff(mRequestId)) {
mSigningIn = true;
@@ -33,7 +33,8 @@ import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.client.EhCookieStore;
import com.hippo.ehviewer.client.EhUrl;
import com.hippo.ehviewer.client.EhUtils;
import com.hippo.yorozuya.AssertUtils;
import junit.framework.Assert;
import java.util.ArrayList;
import java.util.Collections;
@@ -62,7 +63,7 @@ public class WebViewSignInScene extends SolidScene {
public View onCreateView2(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Context context = getContext2();
AssertUtils.assertNotNull(context);
Assert.assertNotNull(context);
EhUtils.signOut(context);
@@ -28,9 +28,10 @@ import android.view.View;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.ui.EhActivity;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.IntIdGenerator;
import junit.framework.Assert;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -329,7 +330,7 @@ public abstract class StageActivity extends EhActivity {
String tag = mSceneTagList.get(mSceneTagList.size() - 1);
Fragment fragment = fragmentManager.findFragmentByTag(tag);
if (fragment != null) {
AssertUtils.assertInstanceOf(fragment, SceneFragment.class);
Assert.assertEquals(fragment.getClass(), SceneFragment.class);
currentScene = (SceneFragment) fragment;
}
}
@@ -29,9 +29,10 @@ import android.view.animation.Interpolator;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.AnimationUtils;
import com.hippo.yorozuya.AssertUtils;
import com.hippo.yorozuya.SimpleAnimatorListener;
import junit.framework.Assert;
public class FabLayout extends ViewGroup implements View.OnClickListener {
private static final long ANIMATE_TIME = 300L;
@@ -108,9 +109,9 @@ public class FabLayout extends ViewGroup implements View.OnClickListener {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
AssertUtils.assertEquals("Measure mode must be MeasureSpec.EXACTLY",
Assert.assertEquals("Measure mode must be MeasureSpec.EXACTLY",
MeasureSpec.getMode(widthMeasureSpec), MeasureSpec.EXACTLY);
AssertUtils.assertEquals("Measure mode must be MeasureSpec.EXACTLY",
Assert.assertEquals("Measure mode must be MeasureSpec.EXACTLY",
MeasureSpec.getMode(heightMeasureSpec), MeasureSpec.EXACTLY);
int width = MeasureSpec.getSize(widthMeasureSpec);
@@ -23,7 +23,8 @@ import android.view.View;
import android.view.ViewGroup;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.AssertUtils;
import junit.framework.Assert;
public class MaxSizeContainer extends ViewGroup {
@@ -69,7 +70,7 @@ public class MaxSizeContainer extends ViewGroup {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
AssertUtils.assertEquals("getChildCount() must be 1", 1, getChildCount());
Assert.assertEquals("getChildCount() must be 1", 1, getChildCount());
View child = getChildAt(0);
if (child.getVisibility() != GONE) {
@@ -83,7 +84,7 @@ public class MaxSizeContainer extends ViewGroup {
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
AssertUtils.assertEquals("getChildCount() must be 1", 1, getChildCount());
Assert.assertEquals("getChildCount() must be 1", 1, getChildCount());
View child = getChildAt(0);
if (child.getVisibility() != GONE) {