轻量级前端框架助力开发者提升项目效率与性能
911
2022-10-17
Cangol-UIFrame- Android 菜单框架
Cangol-UIFrame 是一款App UI 框架,用于Android应用。
示例代码:
package mobi.cangol.mobile.uiframe.demo; import mobi.cangol.mobile.base.BaseActionBarActivity; import mobi.cangol.mobile.navigation.TabNavigationFragmentActivity; import mobi.cangol.mobile.uiframe.demo.fragment.HomeFragment; import mobi.cangol.mobile.logging.Log; import mobi.cangol.mobile.uiframe.demo.fragment.MenuFragment; import mobi.cangol.mobile.uiframe.demo.fragment.MenuFragment2; import android.annotation.SuppressLint; import android.os.Bundle; @SuppressLint("ResourceAsColor") public class MainActivity extends TabNavigationFragmentActivity { private static long back_pressed; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setStatusBarTintColor(R.color.red); this.setNavigationBarTintColor(R.color.black); setContentView(R.layout.activity_main); this.getCustomActionBar().setBackgroundResource(R.color.red); if (savedInstanceState == null) { this.setMenuFragment(MenuFragment.class,null); this.setContentFragment(HomeFragment.class, "HomeFragment", null); } findViews(); initViews(savedInstanceState); initData(savedInstanceState); //this.setFloatActionBarEnabled(true); this.initFragmentStack(R.id.content_frame); if(savedInstanceState==null) this.replaceFragment(HomeFragment.class, "Home", null); } @Override protected void onStart() { super.onStart(); Log.v("onStart " + System.currentTimeMillis()); } @Override public void findViews() { } @Override public void initViews(Bundle savedInstanceState) { } @Override public void initData(Bundle savedInstanceState) { } @Override public void onBack() { if(back_pressed+2000>System.currentTimeMillis()){ super.onBack(); app.exit(); }else{ back_pressed=System.currentTimeMillis(); showToast("Please on back"); } } public int getContentFrameId() { return R.id.content_frame; } }
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~