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

Java LoadToast类代码示例

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

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



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

示例1: onCreate

import net.steamcrafted.loadtoast.LoadToast; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    lt = new LoadToast(this);
    mOpenLinkBtn = (FloatingActionButton) this.findViewById(R.id.open_link_btn);
    mOpenLinkBtn.setOnClickListener(this);
    mWebview = (WebView) findViewById(R.id.h5_web);
    WebSettings webSettings = mWebview.getSettings();
    webSettings.setSupportZoom(false);
    webSettings.setPluginState(WebSettings.PluginState.ON);
    webSettings.setLoadWithOverviewMode(true);
    webSettings.setJavaScriptEnabled(true);
    mWebview.setWebChromeClient(new WebChromeClient());
    mWebview.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            lt.success();
        }
    });
    Intent receivedIntent = getIntent();
    initIntent(receivedIntent);

}
 
开发者ID:dodola,项目名称:WebPageClip,代码行数:26,代码来源:MainActivity.java


示例2: onCreate

import net.steamcrafted.loadtoast.LoadToast; //导入依赖的package包/类
/**
 * Standard lifecycle method, serving as the main entry
 * point of the activity.
 *
 * @param savedInstanceState the state of a previous instance
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Create the presenter object
    mPresenter = new CameraPresenter(this);

    ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(this));

    final Intent intent = getIntent();
    if(intent.getExtras() != null){
        if(intent.getExtras().containsKey(EXTRA_MODE)){
            mMode = intent.getExtras().getInt(EXTRA_MODE);
        }
        if(intent.getExtras().containsKey(EXTRA_IMAGE_NAME) && mMode == MODE_STUDY){
            mImageName = intent.getExtras().getString(EXTRA_IMAGE_NAME);
            showWhosDialog();
        }
    }

    if(mMode == MODE_STUDY)
        mProgressText = R.string.toast_upload_train;
    else if(mMode == MODE_IDENTIFY)
        mProgressText = R.string.toast_upload_identify;

    mLoadToast = new LoadToast(CameraActivity.this);
    mLoadToast.setProgressColor(getResources().getColor(R.color.color_accent));
    mToast = Toast.makeText(getContext(), "", Toast.LENGTH_SHORT);
    mKairos = Networking.initKairos(getApplicationContext());
    mRotation = CalibrateModel.get(getApplicationContext());

    Utils.validateEnvironment(this);

    ActionBar ab = getActionBar();

    if (ab != null) {
        ab.hide();
    }

    // Handle permissions, needed on Marshmallow+
    String[] perms = netPermissions(getNeededPermissions());

    if (perms.length == 0) {
        init();
    } else {
        requestPermissions(perms, REQUEST_PERMS);
    }
}
 
开发者ID:code-mc,项目名称:FacerecognitionFlowpilots,代码行数:55,代码来源:CameraActivity.java


示例3: getRequest

import net.steamcrafted.loadtoast.LoadToast; //导入依赖的package包/类
private void getRequest() {

        loadToast=new LoadToast(Profile.this);
        loadToast.setText("LOADING");
        loadToast.setTranslationY((int) Utils.convertDpToPixel(70, Profile.this));
        loadToast.show();

      final JsonObjectRequest jsonObjectRequest=new JsonObjectRequest(getURL(), new Response.Listener<JSONObject>() {
          @Override
          public void onResponse(JSONObject response) {
              Log.d("RESPONSE-PROFILE",response.toString());
              try {
                  loadToast.success();
                  JSONObject data=response.getJSONObject("data");
                  String status=response.getString("status");

                  if(status.equals("User Profile Info")){
                      String email=data.getString("email");
                      String name=data.getString("name");
                      int silver_coins=Integer.parseInt(data.getString("silver_coins"));
                      int gold_coins=Integer.parseInt(data.getString("gold_coins"));
                      user=new User();
                      user.setEmail(email);
                      user.setName(name);
                      user.setGoldCoins(gold_coins);
                      user.setSilverCoins(silver_coins);
                      email_textview.setText(email);
                      name_textview.setText(name);
                      silverCoins_textview.setText(Integer.toString(silver_coins));
                      goldCoins_textview.setText(Integer.toString(gold_coins));
                      String roll=null;

                      if(data.has("rollno")){
                          if(!data.isNull("rollno")){
                              roll=data.getString("rollno");
                              username_textview.setText(roll);
                              user.setRoll(roll);
                          }
                          else{
                              username_textview.setVisibility(View.GONE);
                          }
                      }

                  }
              } catch (JSONException e) {
                  e.printStackTrace();
              }
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
                loadToast.error();
          }
      }){
          @Override
          public Map<String, String> getHeaders() throws AuthFailureError {
              Map<String,String> map=new HashMap<>();
              map.put("Authorization","bearer "+new PersonalData(Profile.this).getToken());
              return map;
          }
      };

        jsonObjectRequest.setRetryPolicy(new DefaultRetryPolicy(10000,5,DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
        MySingleton.getInstance(MyApplication.getAppContext()).addToRequestQueue(jsonObjectRequest);
    }
 
开发者ID:appteam-nith,项目名称:festnimbus,代码行数:66,代码来源:Profile.java


示例4: onCreate

import net.steamcrafted.loadtoast.LoadToast; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_leaderboard);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    connection = new Connection(this);
    personalData = new PersonalData(this);

    loadToast = new LoadToast(this);
    loadToast.setText("Loading");
    loadToast.setTranslationY((int) Utils.convertDpToPixel(70, Leaderboard.this));

    recyclerView = (RecyclerView) findViewById(R.id.list_leaderboard);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    adapter = new LeaderboardAdapter();
    recyclerView.setAdapter(adapter);

    if (savedInstanceState != null) {
        list = savedInstanceState.getParcelableArrayList(LIST);
        adapter.setStatus(savedInstanceState.getString(STATUS));
        if(list!=null){
            adapter.refresh(list);
        }


    } else {
        if (connection.isInternet()) {
            sendRequest(getUrl("Silver"));
            loadToast.show();
        } else {
            Toast.makeText(Leaderboard.this, "No Internet Connection", Toast.LENGTH_LONG).show();
        }
    }

    final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (connection.isInternet()) {
                if (!reverse) {
                    sendRequest(getUrl("Gold"));
                    loadToast.show();
                    reverse = true;
                    fab.setImageResource(R.drawable.currency_dollar);
                } else {
                    sendRequest(getUrl("Silver"));
                    loadToast.show();
                    reverse = false;
                    fab.setImageResource(R.drawable.currency_dollar_yellow);
                }
            } else {
                Toast.makeText(Leaderboard.this, "No Internet Connection", Toast.LENGTH_LONG).show();
            }
        }
    });
}
 
开发者ID:appteam-nith,项目名称:festnimbus,代码行数:60,代码来源:Leaderboard.java


示例5: onCreate

import net.steamcrafted.loadtoast.LoadToast; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.hackathon);
    CollapsingToolbarLayout collapsingToolbarLayout= (CollapsingToolbarLayout) findViewById(R.id.collapse_toolbar);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    register_button=(Button)findViewById(R.id.hackathon_register_button);

    loadToast=new LoadToast(EventRegisterActivity.this);
    loadToast.setText("LOADING");
    loadToast.setTranslationY((int) Utils.convertDpToPixel(20, EventRegisterActivity.this));
    text=(TextView)findViewById(R.id.description);
    error_image=(ImageView)findViewById(R.id.error_image);
    error_image.setVisibility(View.GONE);
    final int newColor = getResources().getColor(R.color.new_color);
    error_image.setColorFilter(newColor, PorterDuff.Mode.SRC_ATOP);
    if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
        ImageView logo_image= (ImageView) findViewById(R.id.bgheader);
        logo_image.setTransitionName(getString(R.string.transition_name));
    }

    String toshow="";

    getRegisteredEventRequest(); // for getting array of registered events
    register_button.setVisibility(View.GONE);

    if (savedInstanceState != null) {
        toshow = (String) savedInstanceState.getString(KEY_STRING);
        event=(EventClass) savedInstanceState.getSerializable(KEY_EVENT);
        current_event_registered=(Boolean)savedInstanceState.getSerializable(KEY_SHOW_BUTTON);
        if(current_event_registered==true)
        {register_button.setText("Unregister");}
        else{register_button.setText("Register");}

        if(toshow.contains("Details about event is currently unavailable.")){
            register_button.setVisibility(View.GONE);
            error_image.setVisibility(View.VISIBLE);
        }else{
            register_button.setVisibility(View.VISIBLE);
        }
    }else{
        toshow+="Please wait...\n\n\n";
        event=(EventClass)getIntent().getSerializableExtra("eventPassed");
        register_button.setVisibility(View.GONE);

        loadToast.show();

        getRequest();

    }

    collapsingToolbarLayout.setTitle(event.getName());

    text.setText(toshow);

    register_button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            getRegistrationRequest(event);
            loadToast.show();
        }
    });
}
 
开发者ID:appteam-nith,项目名称:festnimbus,代码行数:66,代码来源:EventRegisterActivity.java


示例6: GetJson

import net.steamcrafted.loadtoast.LoadToast; //导入依赖的package包/类
public GetJson(Activity act) {
    activity = act;
    lt = new LoadToast(activity);
}
 
开发者ID:openfoodfacts,项目名称:openfoodfacts-androidapp,代码行数:5,代码来源:SplashActivity.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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