package com.gh.gamecenter; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import com.gh.common.util.EntranceUtils; import com.gh.gamecenter.entity.ConcernEntity; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.entity.ToolBoxEntity; import com.halo.assistant.fragment.WebFragment; /** * Created by khy on 2016/10/18. */ @Deprecated public class WebActivity extends NormalActivity { @Override protected Intent provideNormalIntent() { return getTargetIntent(this, WebActivity.class, WebFragment.class); } @NonNull public static Intent getWebIntent(Context context) { Intent intent = new Intent(context, WebActivity.class); intent.putExtra(EntranceUtils.KEY_GAMENAME, context.getString(R.string.disclaimer_title)); intent.putExtra(EntranceUtils.KEY_URL, context.getString(R.string.disclaimer_url)); // return new IntentFactory.Builder(context) // .setArgs(intent.getExtras()) // .setActivity(WebActivity.class) // .setFragment(WebFragment.class).build(); Bundle bundle = new Bundle(); bundle.putString(EntranceUtils.KEY_GAMENAME, context.getString(R.string.disclaimer_title)); bundle.putString(EntranceUtils.KEY_URL, context.getString(R.string.disclaimer_url)); return getTargetIntent(context, WebActivity.class, WebFragment.class, bundle); } @NonNull public static Intent getWebByCollectionTools(Context context, ToolBoxEntity toolBoxEntity, boolean isCollectionTools) { // Intent intent = new Intent(context, WebActivity.class); // intent.putExtra(EntranceUtils.KEY_URL, toolBoxEntity.getUrl()); // intent.putExtra(WebFragment.KEY_ISTOOLS, true); //// intent.putExtra("gameName", toolBoxEntity.getName()); // intent.putExtra(ToolBoxEntity.TAG, toolBoxEntity); // intent.putExtra(WebFragment.KEY_ISCOLLECTIONTOOLS, isCollectionTools); // return new IntentFactory.Builder(context) // .setArgs(intent.getExtras()) // .setActivity(WebActivity.class) // .setFragment(WebFragment.class).build(); Bundle bundle = new Bundle(); bundle.putString(EntranceUtils.KEY_URL, toolBoxEntity.getUrl()); bundle.putBoolean(WebFragment.KEY_ISTOOLS, true); bundle.putString(EntranceUtils.KEY_GAMENAME, toolBoxEntity.getName()); bundle.putParcelable(ToolBoxEntity.TAG, toolBoxEntity); bundle.putBoolean(WebFragment.KEY_ISCOLLECTIONTOOLS, isCollectionTools); return getTargetIntent(context, WebActivity.class, WebFragment.class, bundle); } @NonNull public static Intent getIntentByNews(Context context, ConcernEntity concernEntity, String entrance) { // Intent intent = new Intent(context, WebActivity.class); // intent.putExtra(EntranceUtils.KEY_URL, concernEntity.getLink()); // intent.putExtra(EntranceUtils.KEY_GAMENAME, concernEntity.getGameName()); // intent.putExtra(EntranceUtils.KEY_NEWSID, concernEntity.getId()); // intent.putExtra(EntranceUtils.KEY_ENTRANCE, entrance); // return new IntentFactory.Builder(context) // .setArgs(intent.getExtras()) // .setActivity(WebActivity.class) // .setFragment(WebFragment.class).build(); Bundle bundle = new Bundle(); bundle.putString(EntranceUtils.KEY_URL, concernEntity.getLink()); bundle.putString(EntranceUtils.KEY_GAMENAME, concernEntity.getGameName()); bundle.putString(EntranceUtils.KEY_NEWSID, concernEntity.getId()); bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance); return getTargetIntent(context, WebActivity.class, WebFragment.class, bundle); } @NonNull public static Intent getIntentByNews(Context context, NewsEntity newsEntity, String entrance) { // Intent intent = new Intent(context, WebActivity.class); // intent.putExtra(EntranceUtils.KEY_URL, newsEntity.getLink()); // intent.putExtra(EntranceUtils.KEY_GAMENAME, newsEntity.getGameName()); // intent.putExtra(EntranceUtils.KEY_NEWSID, newsEntity.getId()); // intent.putExtra(EntranceUtils.KEY_ENTRANCE, entrance); // return new IntentFactory.Builder(context) // .setArgs(intent.getExtras()) // .setActivity(WebActivity.class) // .setFragment(WebFragment.class).build(); Bundle bundle = new Bundle(); bundle.putString(EntranceUtils.KEY_URL, newsEntity.getLink()); bundle.putString(EntranceUtils.KEY_GAMENAME, newsEntity.getGameName()); bundle.putString(EntranceUtils.KEY_NEWSID, newsEntity.getId()); bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance); return getTargetIntent(context, WebActivity.class, WebFragment.class, bundle); } @NonNull public static Intent getIntentByUrl(Context context, String url) { // Intent intent = new Intent(context, WebActivity.class); // intent.putExtra(EntranceUtils.KEY_URL, url); // return new IntentFactory.Builder(context) // .setArgs(intent.getExtras()) // .setActivity(WebActivity.class) // .setFragment(WebFragment.class).build(); Bundle bundle = new Bundle(); bundle.putString(EntranceUtils.KEY_URL, url); return getTargetIntent(context, WebActivity.class, WebFragment.class, bundle); } }