use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class CrashScene method onClick.
@Override
public void onClick(View v) {
MainActivity activity = getActivity2();
if (mSend == v && null != mCrash && null != activity) {
AppHelper.sendEmail(activity, EhApplication.getDeveloperEmail(), "I found a bug in EhViewer !", mCrash);
}
Crash.resetCrashFile();
// Start new scene and finish it self
if (null != activity) {
startSceneForCheckStep(CHECK_STEP_CRASH, getArguments());
}
finish();
}
use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class DownloadsScene method guideDownloadThumb.
private void guideDownloadThumb() {
MainActivity activity = getActivity2();
if (null == activity || !Settings.getGuideDownloadThumb() || null == mLayoutManager || null == mRecyclerView) {
guideDownloadLabels();
return;
}
int position = mLayoutManager.findFirstCompletelyVisibleItemPositions(null)[0];
if (position < 0) {
guideDownloadLabels();
return;
}
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(position);
if (null == holder) {
guideDownloadLabels();
return;
}
mShowcaseView = new ShowcaseView.Builder(activity).withMaterialShowcase().setStyle(R.style.Guide).setTarget(new ViewTarget(((DownloadHolder) holder).thumb)).blockAllTouches().setContentTitle(R.string.guide_download_thumb_title).setContentText(R.string.guide_download_thumb_text).replaceEndButton(R.layout.button_guide).setShowcaseEventListener(new SimpleShowcaseEventListener() {
@Override
public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
mShowcaseView = null;
ViewUtils.removeFromParent(showcaseView);
Settings.putGuideDownloadThumb(false);
guideDownloadLabels();
}
}).build();
}
use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class DownloadsScene method guideDownloadLabels.
private void guideDownloadLabels() {
MainActivity activity = getActivity2();
if (null == activity || !Settings.getGuideDownloadLabels()) {
return;
}
Display display = activity.getWindowManager().getDefaultDisplay();
Point point = new Point();
display.getSize(point);
mShowcaseView = new ShowcaseView.Builder(activity).withMaterialShowcase().setStyle(R.style.Guide).setTarget(new PointTarget(point.x, point.y / 3)).blockAllTouches().setContentTitle(R.string.guide_download_labels_title).setContentText(R.string.guide_download_labels_text).replaceEndButton(R.layout.button_guide).setShowcaseEventListener(new SimpleShowcaseEventListener() {
@Override
public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
mShowcaseView = null;
ViewUtils.removeFromParent(showcaseView);
Settings.puttGuideDownloadLabels(false);
openDrawer(Gravity.RIGHT);
}
}).build();
}
use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class HistoryScene method onItemLongClick.
@Override
public boolean onItemLongClick(EasyRecyclerView parent, View view, int position, long id) {
final Context context = getContext2();
final MainActivity activity = getActivity2();
if (null == context || null == activity || null == mLazyList) {
return false;
}
final GalleryInfo gi = mLazyList.get(position);
new AlertDialog.Builder(context).setTitle(EhUtils.getSuitableTitle(gi)).setItems(R.array.gallery_list_menu_entries, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch(which) {
case // Download
0:
CommonOperations.startDownload(activity, gi, false);
break;
case // Favorites
1:
CommonOperations.addToFavorites(activity, gi, new addToFavoriteListener(context, activity.getStageId(), getTag()));
break;
}
}
}).show();
return true;
}
use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class SecurityScene method onShake.
@Override
public void onShake(int count) {
if (count == 10) {
MainActivity activity = getActivity2();
if (null == activity) {
return;
}
Settings.putSecurity("");
startSceneForCheckStep(CHECK_STEP_SECURITY, getArguments());
finish();
}
}
Aggregations