• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Style类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.johnpersano.supertoasts.util.Style的典型用法代码示例。如果您正苦于以下问题:Java Style类的具体用法?Java Style怎么用?Java Style使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Style类属于com.github.johnpersano.supertoasts.util包,在下文中一共展示了Style类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onKeyDown

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
            if ((System.currentTimeMillis() - exitTime) > 3000) {
//                TToast.show(getResources().getString(R.string.exit_once_more_hint));
//                Snackbar.make(mContainer,R.string.exit_once_more_hint,Snackbar.LENGTH_SHORT).show();
                SuperActivityToast.create(this, getResources().getString(R.string.exit_once_more_hint),
                        SuperToast.Duration.SHORT, Style.getStyle(Style.BLUE, SuperToast.Animations.FLYIN)).show();
                exitTime = System.currentTimeMillis();
            } else {
                finish();
            }
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
 
开发者ID:MiracleWong,项目名称:MWZhiHuDaily,代码行数:18,代码来源:MainActivity.java


示例2: showMsg

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
public void showMsg(int kind, String msg){
    SuperToast superToast = null;
    switch (kind){
        case TOAST_ALERT:
            superToast = SuperToast.create(this, msg, SuperToast.Duration.LONG,
                    Style.getStyle(Style.RED, SuperToast.Animations.POPUP));
        break;
        case TOAST_INFO:
        superToast = SuperToast.create(this, msg, SuperToast.Duration.LONG,
                Style.getStyle(Style.GRAY, SuperToast.Animations.POPUP));
        break;
        case TOAST_SUCCESS:
        superToast = SuperToast.create(this, msg, SuperToast.Duration.LONG,
                Style.getStyle(Style.GREEN, SuperToast.Animations.POPUP));
        break;
    }
    superToast.show();
}
 
开发者ID:ayaseruri,项目名称:tongnews,代码行数:19,代码来源:MApplication.java


示例3: afterSearchResult

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
private void afterSearchResult(List<SongInfo> songInfos){
    if(null == songInfos){
        SuperToast.create(getActivity()
                , "什么都没有找到"
                , SuperToast.Duration.LONG
                , Style.getStyle(Style.RED, SuperToast.Animations.FADE)).show();
    }else {
        SearchListAdaptar searchListAdaptar = new SearchListAdaptar(getActivity(), songInfos, new SearchListAdaptar.ItemClick() {
            @Override
            public void onSearchItemClick(int postion, SongInfo songInfo) {
                ((MainActivity)getActivity()).onSearchItemClick(songInfo);
            }
        });

        searchRecycler.setAdapter(searchListAdaptar);
    }
}
 
开发者ID:ayaseruri,项目名称:TorrFM,代码行数:18,代码来源:SearchFragment.java


示例4: onTaskCompleted

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
public void onTaskCompleted(UnicapRequestResult result) {

    final StudentCredentials credentials = mAuthTask.getCredentials();

    if (result.isSuccess()) {

        int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);
        mRegistrationSignInButton.animate().setDuration(shortAnimTime).alpha(0).setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {

                Bundle data = new Bundle();
                data.putString(AccountManager.KEY_ACCOUNT_NAME, credentials.getRegistration());
                data.putString(AccountManager.KEY_ACCOUNT_TYPE, AccountGeneral.ACCOUNT_TYPE);
                data.putString(AccountManager.KEY_AUTHTOKEN, credentials.getAuthToken());
                data.putString(PARAM_USER_PASS, credentials.getPassword());

                Intent intent = new Intent();
                intent.putExtras(data);
                finishLogin(intent);
            }
        });

    } else {

        onTaskCancelled();

        // Clean up to prevent broken data
        UnicapDataManager.cleanUserData(credentials.getRegistration());

        SuperToast superToast = new SuperToast(LoginActivity.this, Style.getStyle(Style.RED, SuperToast.Animations.FLYIN));
        superToast.setText(result.getExceptionMessage(LoginActivity.this));
        superToast.setDuration(SuperToast.Duration.EXTRA_LONG);
        superToast.setIcon(R.drawable.ic_warning_white_24dp, SuperToast.IconPosition.LEFT);
        superToast.show();
    }

    isLoginInProgress = false;
}
 
开发者ID:gabrielduque,项目名称:unicap,代码行数:41,代码来源:LoginActivity.java


示例5: create

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
/**
 * Returns a {@value #TAG} with a specified style.
 *
 * @param activity         {@link android.app.Activity}
 * @param textCharSequence {@link CharSequence}
 * @param durationInteger  {@link com.github.johnpersano.supertoasts.SuperToast.Duration}
 * @param style            {@link com.github.johnpersano.supertoasts.util.Style}
 *
 * @return {@link SuperActivityToast}
 */
public static SuperActivityToast create(Activity activity, CharSequence textCharSequence, int durationInteger, Style style) {

    final SuperActivityToast superActivityToast = new SuperActivityToast(activity);
    superActivityToast.setText(textCharSequence);
    superActivityToast.setDuration(durationInteger);
    superActivityToast.setStyle(style);

    return superActivityToast;

}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:21,代码来源:SuperActivityToast.java


示例6: setStyle

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
/**
 * Private method used to set a default style to the {@value #TAG}
 */
private void setStyle(Style style) {

    this.setAnimations(style.animations);
    this.setTypefaceStyle(style.typefaceStyle);
    this.setTextColor(style.textColor);
    this.setBackground(style.background);

}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:12,代码来源:SuperToast.java


示例7: create

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
/**
 * Returns a {@value #TAG} with a specified style.
 *
 * @param context          {@link android.content.Context}
 * @param textCharSequence {@link CharSequence}
 * @param durationInteger  {@link com.github.johnpersano.supertoasts.SuperToast.Duration}
 * @param style            {@link com.github.johnpersano.supertoasts.util.Style}
 *
 * @return SuperCardToast
 */
public static SuperToast create(Context context, CharSequence textCharSequence, int durationInteger, Style style) {

    final SuperToast superToast = new SuperToast(context);
    superToast.setText(textCharSequence);
    superToast.setDuration(durationInteger);
    superToast.setStyle(style);

    return superToast;

}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:21,代码来源:SuperToast.java


示例8: onOptionsItemSelected

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        SuperToast.create(KaoYanApplication.appContext, "Setting", SuperToast.Duration.SHORT,
                Style.getStyle(Style.BLUE, SuperToast.Animations.SCALE)).show();
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:AotY,项目名称:KaoYanApp,代码行数:11,代码来源:MainActivity.java


示例9: deletMusicByName

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
void deletMusicByName(final String songName) {
    Observable.create(new Observable.OnSubscribe<String>() {
        @Override
        public void call(Subscriber<? super String> subscriber) {
            try {
                Dao dao = dbHelper.getDao(SongInfo.class);
                DeleteBuilder deleteBuilder = dao.deleteBuilder();
                deleteBuilder.where().eq("title", songName);
                deleteBuilder.delete();
                subscriber.onCompleted();
            } catch (SQLException e) {
                e.printStackTrace();
                subscriber.onError(e);
            }
        }
    })
            .subscribeOn(Schedulers.from(Constant.executor))
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Action1<String>() {
                @Override
                public void call(String s) {

                }
            }, new Action1<Throwable>() {
                @Override
                public void call(Throwable throwable) {
                    SuperToast.create(getActivity()
                            , "删除歌曲失败"
                            , SuperToast.Duration.LONG
                            , Style.getStyle(Style.RED, SuperToast.Animations.FADE)).show();
                }
            });
}
 
开发者ID:ayaseruri,项目名称:TorrFM,代码行数:34,代码来源:MainFragment.java


示例10: preparePlay

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
public void preparePlay() {
    checkIsLike();
    if (null != musicPlayModel.getMusicInfoCurrent().getSrc()) {
        try {
            mediaPlayer.reset();
            mediaPlayer.setDataSource(musicPlayModel.getMusicInfoCurrent().getSrc());
            mediaPlayer.prepareAsync();
        } catch (IOException e) {
            e.printStackTrace();
            SuperToast.create(mContext, "歌曲信息出错", SuperToast.Duration.LONG, Style.getStyle(Style.RED, SuperToast.Animations.FADE)).show();
        }
    } else {
        SuperToast.create(mContext, "歌曲信息出错", SuperToast.Duration.LONG, Style.getStyle(Style.RED, SuperToast.Animations.FADE)).show();
    }
}
 
开发者ID:ayaseruri,项目名称:TorrFM,代码行数:16,代码来源:MusicController.java


示例11: onSearch

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Click(R.id.search_icon)
void onSearch(){
    if(0 == mainViewPager.getCurrentItem()){
        switchPager(true, switchPagerDuration);
        materialMenu.animateIconState(MaterialMenuDrawable.IconState.ARROW);
        YoYo.with(Techniques.FadeOutLeft).duration(switchPagerDuration).playOn(title);
        YoYo.with(Techniques.FadeOutLeft).duration(switchPagerDuration).playOn(subTitle);
        if (searchET.getVisibility() == View.GONE) {
            searchET.setVisibility(View.VISIBLE);
        }
        YoYo.with(Techniques.FadeIn).duration(switchPagerDuration).withListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                searchET.setFocusable(true);
                searchET.setFocusableInTouchMode(true);
                searchET.requestFocus();
            }
        }).playOn(searchET);
    }else {
        if("".equals(searchET.getText().toString())){
            YoYo.with(Techniques.Shake).playOn(searchET);
            SuperToast.create(this
                    , "搜索文字不能为空"
                    , SuperToast.Duration.LONG
                    , Style.getStyle(Style.RED
                    , SuperToast.Animations.FADE)).show();
        }else {
            searchFragment.search(searchET.getText().toString(), true);
        }
    }
}
 
开发者ID:ayaseruri,项目名称:TorrFM,代码行数:32,代码来源:MainActivity.java


示例12: onCancelled

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
protected void onCancelled() {
    pull.setRefreshing(false);
    SuperToast.create(
            fragment.getActivity(),
            context.getString(R.string.repo_add_successful),
            SuperToast.Duration.VERY_SHORT,
            Style.getStyle(Style.BLUE)
    ).show();
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:11,代码来源:AddTask.java


示例13: logoutAction

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
private void logoutAction() {
    RAction rAction = new RAction(MainActivity.this);
    BAction bAction = new BAction(MainActivity.this);

    try {
        rAction.openDatabase(true);
        bAction.openDatabase(true);

        rAction.deleteAll();
        bAction.unMarkAll();

        rAction.closeDatabase();
        bAction.closeDatabase();
    } catch (SQLException s) {
        rAction.closeDatabase();
        bAction.closeDatabase();

        SuperToast.create(
                MainActivity.this,
                getString(R.string.main_logout_failed),
                SuperToast.Duration.VERY_SHORT,
                Style.getStyle(Style.RED)
        ).show();
    }

    SharedPreferences preferences = getSharedPreferences(getString(R.string.login_sp), MODE_PRIVATE);
    SharedPreferences.Editor editor = preferences.edit();
    editor.remove(getString(R.string.login_sp_oauth));
    editor.remove(getString(R.string.login_sp_username));
    editor.remove(getString(R.string.login_sp_highlight_num));
    editor.remove(getString(R.string.login_sp_highlight_css));
    editor.commit();

    fragment.allTaskDown();
    Intent intent = new Intent(MainActivity.this, LoginActivity.class);
    startActivity(intent);
    MainActivity.this.finish();
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:39,代码来源:MainActivity.java


示例14: setStyle

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
/**
 * Private method used to set a default style to the {@value #TAG}
 */
private void setStyle(Style style) {

    this.setAnimations(style.animations);
    this.setTypefaceStyle(style.typefaceStyle);
    this.setTextColor(style.textColor);
    this.setBackground(style.background);

    if (this.mType == Type.BUTTON) {

        this.setDividerColor(style.dividerColor);
        this.setButtonTextColor(style.buttonTextColor);

    }

}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:19,代码来源:SuperActivityToast.java


示例15: setStyle

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
/**
 * Private method used to set a default style to the {@value #TAG}
 */
private void setStyle(Style style) {

    this.setAnimations(style.animations);
    this.setTypefaceStyle(style.typefaceStyle);
    this.setTextColor(style.textColor);
    this.setBackground(style.background);

    if(this.mType == Type.BUTTON) {

        this.setDividerColor(style.dividerColor);
        this.setButtonTextColor(style.buttonTextColor);

    }

}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:19,代码来源:SuperCardToast.java


示例16: onPostExecute

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean result) {
    if (result) {
        RAction action = new RAction(context);
        try {
            action.openDatabase(true);
        } catch (SQLException s) {
            fragment.setContentEmpty(true);
            fragment.setEmptyText(R.string.repo_empty_error);
            fragment.setContentShown(true);
            return;
        }

        List<Repo> repos = action.listRepos();
        Collections.sort(repos);

        List<Map<String, String>> autoList = new ArrayList<Map<String, String>>();

        list.clear();
        autoList.clear();
        for (Repo r : repos) {
            list.add(
                    new RepoItem(
                            r.getName(),
                            r.getDate(),
                            r.getDescription(),
                            r.getLang(),
                            r.getStar(),
                            r.getFork(),
                            r.getOwner(),
                            r.getGit()
                    )
            );
            Map<String, String> map = new HashMap<String, String>();
            map.put("owner", r.getOwner());
            map.put("name", r.getName());
            autoList.add(map);
        }
        action.closeDatabase();

        SimpleAdapter autoAdapter = new SimpleAdapter(
                context,
                autoList,
                R.layout.auto_item,
                new String[] {"owner", "name"},
                new int[] {R.id.auto_item_owner, R.id.auto_item_name}
        );
        autoAdapter.notifyDataSetChanged();
        fragment.getSearch().setAdapter(autoAdapter);

        if (list.size() <= 0) {
            fragment.setContentEmpty(true);
            fragment.setEmptyText(R.string.repo_empty_list);
            fragment.setContentShown(true);
        } else {
            fragment.setContentEmpty(false);
            adapter.notifyDataSetChanged();
            fragment.setContentShown(true);
        }

        if (flag == Flag.REPO_REFRESH) {
            SuperToast.create(
                    context,
                    context.getString(R.string.repo_refresh_successful),
                    SuperToast.Duration.VERY_SHORT,
                    Style.getStyle(Style.BLUE)
            ).show();
        }
    } else {
        fragment.setContentEmpty(true);
        fragment.setEmptyText(R.string.repo_empty_error);
        fragment.setContentShown(true);
    }
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:75,代码来源:RepoTask.java


示例17: onPostExecute

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean result) {
    if (result) {
        SuperToast.create(
                context,
                context.getString(R.string.webview_wait),
                SuperToast.Duration.VERY_SHORT,
                Style.getStyle(Style.BLUE)
        ).show();

        String[] arr = context.getResources().getStringArray(R.array.dialog_highlight_list);
        if (css.equals(arr[0].toLowerCase())) {
            webView.setBackgroundColor(
                    context.getResources().getColor(R.color.github)
            );
        } else if (css.equals(arr[1].toLowerCase())) {
            webView.setBackgroundColor(
                    context.getResources().getColor(R.color.monokai)
            );
        } else if (css.equals(arr[2].toLowerCase())) {
            webView.setBackgroundColor(
                    context.getResources().getColor(R.color.solarized)
            );
        } else if (css.equals(arr[3].toLowerCase())) {
            webView.setBackgroundColor(
                    context.getResources().getColor(R.color.sunburst)
            );
        } else {
            webView.setBackgroundColor(
                    context.getResources().getColor(R.color.tomorrow)
            );
        }

        if (MimeType.isImage(filename)) {
            webView.loadDataWithBaseURL(
                    null,
                    image,
                    null,
                    context.getString(R.string.webview_encoding),
                    null
            );
        } else if (MimeType.isMarkdown(filename)) {
            webView.loadDataWithBaseURL(
                    StyleMarkdown.BASE_URL,
                    content,
                    null,
                    context.getString(R.string.webview_encoding),
                    null
            );
        } else {
            webView.loadDataWithBaseURL(
                    SyntaxCode.BASE_URL,
                    content,
                    null,
                    context.getString(R.string.webview_encoding),
                    null
            );
        }

        fragment.setContentEmpty(false);
        fragment.setContentShown(true);
    } else {
        webView.setVisibility(View.GONE);
        fragment.setContentEmpty(true);
        fragment.setEmptyText(R.string.webview_empty_error);
        fragment.setContentShown(true);
    }
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:69,代码来源:WebViewTask.java


示例18: onCreate

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

    /*
     * 检测用户登陆状态
     *
     * 如果SharedPreferences中存在用户信息,
     * 则说明用户已经登陆,此时直接跳转到MainActivity即可;
     * 否则进入登陆界面
     */
    sharedPreferences = getSharedPreferences(getString(R.string.login_sp), MODE_PRIVATE);
    String oAuth = sharedPreferences.getString(getString(R.string.login_sp_oauth), null);
    if (oAuth != null) {
        Intent intent = new Intent(LoginActivity.this, MainActivity.class);
        intent.putExtra(getString(R.string.login_intent), false);
        startActivity(intent);
        finish();
    }

    getActionBar().setDisplayShowHomeEnabled(false);

    final EditText userText = (EditText) findViewById(R.id.login_username);
    final EditText passText = (EditText) findViewById(R.id.login_password);
    /* 保持EditText字体的一致性 */
    passText.setTypeface(Typeface.DEFAULT);
    passText.setTransformationMethod(new PasswordTransformationMethod());
    Button button = (Button) findViewById(R.id.login_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            username = userText.getText().toString();
            password = passText.getText().toString();

            /* 给出相应的错误提示 */
            if (username.length() == 0 && password.length() == 0) {
                SuperToast.create(
                        LoginActivity.this,
                        getString(R.string.login_message_miss_both),
                        SuperToast.Duration.SHORT,
                        Style.getStyle(Style.RED)
                ).show();
            } else if (username.length() != 0 && password.length() == 0) {
                SuperToast.create(
                        LoginActivity.this,
                        getString(R.string.login_message_miss_password),
                        SuperToast.Duration.SHORT,
                        Style.getStyle(Style.RED)
                ).show();
            } else if (username.length() == 0 && password.length() != 0) {
                SuperToast.create(
                        LoginActivity.this,
                        getString(R.string.login_message_miss_username),
                        SuperToast.Duration.SHORT,
                        Style.getStyle(Style.RED)
                ).show();
            } else {
                /* ProgressDialog显示当前正在运行的状态 */
                progressDialog = new ProgressDialog(LoginActivity.this);
                progressDialog.setMessage(getString(R.string.login_message_authoring));
                progressDialog.setCancelable(false);
                progressDialog.show();
                /* 开启新的线程用于认证 */
                HandlerThread handlerThread = new HandlerThread(getString(R.string.login_thread));
                handlerThread.start();
                Handler handler = new Handler(handlerThread.getLooper());
                handler.post(authorizationThread);
            }
        }
    });

}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:74,代码来源:LoginActivity.java


示例19: clickWhenBookmark

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
private void clickWhenBookmark(int position) {
    allTaskDown();

    bookmarkItem = bookmarkItemList.get(position);

    owner = bookmarkItem.getOwner();
    name = bookmarkItem.getName();

    if (bookmarkItem.getType().equals("tree")) {
        hideWhenContent();

        title = bookmarkItem.getTitle();
        subTitle = name + "/" + bookmarkItem.getPath();
        actionBar.setTitle(title);
        actionBar.setSubtitle(subTitle);
        actionBar.setDisplayHomeAsUpEnabled(true);

        listView.setAdapter(contentItemAdapter);
        contentItemAdapter.notifyDataSetChanged();

        root = null;
        entry = null;
        toggle = true;
        prefix = bookmarkItem.getPath();

        switch (flag) {
            case Flag.REPO_FIRST:
            case Flag.REPO_SECOND:
            case Flag.REPO_REFRESH:
            case Flag.REPO_CONTENT_FIRST:
            case Flag.REPO_CONTENT_SECOND:
            case Flag.REPO_CONTENT_REFRESH:
                flag = Flag.REPO_CONTENT_FIRST;
                currentId = REPO_CONTENT_ID;
                repoContentTask = new RepoContentTask(MainFragment.this);
                repoContentTask.execute();
                break;
            case Flag.STAR_FIRST:
            case Flag.STAR_SECOND:
            case Flag.STAR_REFRESH:
            case Flag.STAR_CONTENT_FIRST:
            case Flag.STAR_CONTENT_SECOND:
            case Flag.STAR_CONTENT_REFRESH:
                flag = Flag.STAR_CONTENT_FIRST;
                currentId = STAR_CONTENT_ID;
                starContentTask = new StarContentTask(MainFragment.this);
                starContentTask.execute();
                break;
            default:
                break;
        }
    } else {
        if (MimeType.isUnSupport(bookmarkItem.getTitle())) {
            SuperToast.create(
                    view.getContext(),
                    getString(R.string.webview_unsupport),
                    SuperToast.Duration.VERY_SHORT,
                    Style.getStyle(Style.RED)
            ).show();
        } else {
            Intent intent = new Intent(getActivity(), WebViewActivity.class);
            intent.putExtra(getString(R.string.webview_intent_title), bookmarkItem.getTitle());
            String sub = bookmarkItem.getName() + "/" + bookmarkItem.getPath();
            intent.putExtra(getString(R.string.webview_intent_subtitle), sub);
            intent.putExtra(getString(R.string.webview_intent_owner), bookmarkItem.getOwner());
            intent.putExtra(getString(R.string.webview_intent_name), bookmarkItem.getName());
            intent.putExtra(getString(R.string.webview_intent_sha), bookmarkItem.getSha());
            startActivity(intent);
        }
    }
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:72,代码来源:MainFragment.java


示例20: clickWhenRepoContent

import com.github.johnpersano.supertoasts.util.Style; //导入依赖的package包/类
private void clickWhenRepoContent(int position) {
    allTaskDown();

    ContentItem item = contentItemList.get(position);

    if (item.getEntry().getType().equals("tree")) {
        entry = item.getEntry();

        String[] arr = entry.getPath().split("/");
        title = arr[arr.length - 1];
        if (toggle) {
            if (prefix.equals("/")) {
                subTitle = name
                        + "/"
                        + entry.getPath();
            } else {
                subTitle = name
                        + "/"
                        + prefix
                        + "/"
                        + entry.getPath();
            }
        } else {
            subTitle = name + "/" + entry.getPath();
        }
        actionBar.setTitle(title);
        actionBar.setSubtitle(subTitle);
        actionBar.setDisplayHomeAsUpEnabled(true);

        flag = Flag.REPO_CONTENT_SECOND;
        currentId = REPO_CONTENT_ID;
        repoContentTask = new RepoContentTask(MainFragment.this);
        repoContentTask.execute();
    } else {
        TreeEntry e = item.getEntry();
        String[] a = e.getPath().split("/");
        String t = a[a.length - 1];

        if (MimeType.isUnSupport(t)) {
            SuperToast.create(
                    view.getContext(),
                    getString(R.string.webview_unsupport),
                    SuperToast.Duration.VERY_SHORT,
                    Style.getStyle(Style.RED)
            ).show();
        } else {
            String s;
            if (toggle) {
                if (prefix.equals("/")) {
                    s = name + "/" + e.getPath();
                } else {
                    s = name + "/" + prefix + "/" + e.getPath();
                }
            } else {
                s = name + "/" + e.getPath();
            }
            Intent intent = new Intent(getActivity(), WebViewActivity.class);
            intent.putExtra(getString(R.string.webview_intent_title), t);
            intent.putExtra(getString(R.string.webview_intent_subtitle), s);
            intent.putExtra(getString(R.string.webview_intent_owner), owner);
            intent.putExtra(getString(R.string.webview_intent_name), name);
            intent.putExtra(getString(R.string.webview_intent_sha), item.getEntry().getSha());
            startActivity(intent);
        }
    }
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:67,代码来源:MainFragment.java



注:本文中的com.github.johnpersano.supertoasts.util.Style类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InitialNameService类代码示例发布时间:2022-05-22
下一篇:
Java ServiceLocator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap