首页 文章 精选 留言 我的

精选列表

搜索[企业级UI],共10000篇文章
优秀的个人博客,低调大师

Android UI-仿微信底部导航栏布局

现在App基本的标配除了侧滑菜单,还有一个就是底部导航栏,常见的聊天工具QQ,微信,购物App都有底部导航栏,用户可以随便切换看不同的内容,说是情怀也好,用户体验也罢。我们开发的主要的还是讲的是如何如何实现其功能,网上实现的方式无外乎两种,一种是使用tabhost进行切换,一种是直接使用Fragment进行切换,底部导航栏的布局有的使用的是线性布局,有的是使用的RadioGroup,本文中是使用fragment+RadioGroup是实现的,看正文吧: 基础布局 其中主要低 底部导航栏,其他都没有什么,上面是一个Fragment自己替换一下即可,关于Fragment的使用可参考本人之前的博客; activity_main.xml中的布局文件,由于样式比较多可以单独的放在style中的,鉴于方便查看,直接放在布局文件中,activity_main中的代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "fill_parent" android:layout_height= "fill_parent" android:orientation= "vertical" tools:context= "com.example.googlebottomfragment.MainActivity" > <FrameLayout android:id= "@+id/main_content" android:layout_width= "fill_parent" android:layout_height= "0dp" android:layout_weight= "1" /> <RadioGroup android:id= "@+id/tab_menu" android:layout_width= "fill_parent" android:layout_height= "wrap_content" android:background= "@drawable/mmfooter_bg" android:orientation= "horizontal" > <RadioButton android:id= "@+id/rbChat" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:checked= "true" android:drawableTop= "@drawable/tab_selector_weixing" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "微信" android:textColor= "@color/tab_selector_tv_color" /> <RadioButton android:id= "@+id/rbAddress" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:drawableTop= "@drawable/tab_selector_tongxunlu" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "通讯录" android:textColor= "@color/tab_selector_tv_color" /> <RadioButton android:id= "@+id/rbFind" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:drawableTop= "@drawable/tab_selector_faxian" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "发现" android:textColor= "@color/tab_selector_tv_color" /> <RadioButton android:id= "@+id/rbMe" android:layout_width= "0dp" android:layout_height= "wrap_content" android:layout_gravity= "bottom" android:layout_weight= "1" android:background= "@drawable/tab_selector_checked_bg" android:button= "@null" android:drawableTop= "@drawable/tab_selector_wo" android:gravity= "center_horizontal|bottom" android:paddingTop= "2dp" android:text= "我" android:textColor= "@color/tab_selector_tv_color" /> </RadioGroup> </LinearLayout> 看下新建的布局和资源文件: 其中tab_selector_tv_color.xml主要是用于控制切换的时候显示下面字体的颜色: 1 2 3 4 5 6 7 8 <?xml version= "1.0" encoding= "utf-8" ?> <selector xmlns:android= "http://schemas.android.com/apk/res/android" > <item android:state_checked= "true" android:color= "@android:color/white" /> <item android:state_checked= "false" android:color= "@android:color/darker_gray" /> <item android:color= "@android:color/darker_gray" /> </selector> 其中tab_selector_checked_bg.xml布局文件选中的时候每个RadioButtton的背景颜色: 1 2 3 4 5 6 7 8 <?xml version= "1.0" encoding= "utf-8" ?> <selector xmlns:android= "http://schemas.android.com/apk/res/android" > <item android:state_checked= "true" android:drawable= "@drawable/tab_bg_halo" /> </selector> 其中tab_selector_weixing.xml主要是点击的时候显示不同的图片,一个是绿色的,一个是白色: 1 2 3 4 5 6 <?xml version= "1.0" encoding= "utf-8" ?> <selector xmlns:android= "http://schemas.android.com/apk/res/android" > <item android:state_checked= "false" android:drawable= "@drawable/tab_weixin_normal" ></item> <item android:state_checked= "true" android:drawable= "@drawable/tab_weixin_pressed" ></item> </selector> 其中需要切换的chat.xml,address.xml,find.xml,me.xml都是一样的,其中chat.xml代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 <?xml version= "1.0" encoding= "utf-8" ?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" > <TextView android:layout_height= "wrap_content" android:layout_width= "wrap_content" android:text= "微信" android:textSize= "20sp" /> <TextView android:layout_height= "wrap_content" android:layout_width= "wrap_content" android:text= "http://www.cnblogs.com/xiaofeixiang" android:textSize= "15sp" /> </LinearLayout> 实现Demo MainActivity.java中的代码,主要的就是设置一下OnCheckedChangeListener,注意MainActivity中需要继承FragmentActivity: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 public void initView() { chat = new FragmentChat(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, chat).commit(); myTabRg = (RadioGroup) findViewById(R.id.tab_menu); myTabRg.setOnCheckedChangeListener( new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub switch (checkedId) { case R.id.rbChat: chat = new FragmentChat(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, chat) .commit(); break ; case R.id.rbAddress: if (address== null ) { address = new FragmentAddress(); } Log.i( "MyFragment" , "FragmentAddress" ); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, address).commit(); break ; case R.id.rbFind: find = new FragmentFind(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, find) .commit(); break ; case R.id.rbMe: me = new FragmentMe(); getSupportFragmentManager().beginTransaction().replace(R.id.main_content, me) .commit(); break ; default : break ; } } }); FragmentChat中的代码,其余的三个FragmentAddress,FragmentFind,FragmentMe类似,就不贴代码了,主要是继承Fragment 即可: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public class FragmentChat extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super .onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // TODO Auto-generated method stub return inflater.inflate(R.layout.chat, null ); } } 最后看张通讯录的截图吧: 、- 本文转自Fly_Elephant博客园博客,原文链接:http://www.cnblogs.com/xiaofeixiang/p/4156732.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

Docker管理工具Web UI:DockerUI & Shipyard

本文主要介绍两款Docker Web管理工具:DockerUI及Shipyard,并对它们的部署、功能及使用进行对比。 部署方面 运行命令,如果没有镜像默认会进行下载创建 dockerrun-d-p9000:9000-v/var/run/docker.sock:/var/run/docker.sockdockerui/dockerui 输入IP:9000进行访问,访问结果见下图 运行如下命令,同样,如果没有镜像,默认会创建 DockerUI部署很顺利,没遇到任何问题。Shipyard实际使用过程中遇到一些问题, 如:[iptables问题]( 功能及使用体验方面 两者各有优缺点,比较适合配合使用。**DockerUI**DockerUI基于DockerAPI, 提供等同Docker命令行的大部分功能,支持container管理,image管理。 *优点:*支持container批量操作; 支持image管理(虽然比较薄弱) 缺点:*不支持多主机。 dockerui-dashboard.png dockerui-containers.png dockerui-images.png ShipyardShipyard也是完全基于Docker API,支持container管理、engine管理(一个engine就是监听tcp端口的docker daemon)。优点:支持多主机; 支持container及engine资源限制及图形展示; 支持container实例横向扩展; 支持批量创建; 支持创建时自动调度。 缺点:*不支持image管理; 不支持container批量操作。 CentOS7 上 Install Shipyard #yuminstalldocker #systemctlrestartdocker #dockerlogin-uuser-ppassword-esample.aliyun.comregistry.aliyuncs.com #上面docker加速一大段实际就下面这一句 #vi/etc/sysconfig/docker #ADD_REGISTRY='--add-registryxxx.mirror.aliyuncs.com' 这里创建下载镜像的脚本 vishipyard_pull.sh #!/bin/bash dockerpullalpine dockerpulllibrary/shipyard dockerpulllibrary/rethinkdb dockerpullmicrobox/etcd dockerpullshipyard/docker-proxy dockerpullswarm dockerpullshipyard/shipyard 执行脚本,bashshipyard_pull.sh 其实上面的脚本并不是必须执行的,这里如果没有镜像是会默认下载的。 $curl-shttps://shipyard-project.com/deploy|bash-s DeployingShipyard ->StartingDatabase->StartingDiscovery ->StartingCertVolume ->StartingProxy ->StartingSwarmManager ->StartingSwarmAgent->StartingController ShipyardavailableatUsername:adminPassword:shipyard #如果想将安装重新来一遍 #foriin`dockerps|sed'1d'|awk'{print$NF}'`;dodockerrm-f$i;done #停止运行镜像 #dockerstopshipyard-proxyshipyard-certsshipyard-discovery shipyard-rethinkdbshipyard-swarm-agentshipyard-swarm-managershipyard-controller #启动运行的镜像 #dockerstartshipyard-proxyshipyard-certsshipyard-discovery shipyard-rethinkdbshipyard-swarm-agentshipyard-swarm-managershipyard-controller #查看运行的docker进程 #dockerps #查看下载的镜像 #dockerimages 增加节点 [root@localhost~]#curl-sSLhttps://shipyard-project.com/deploy| ACTION=nodeDISCOVERY=etcd://192.168.190.147:4001bash-sAddingNode ->StartingCertVolume ->StartingProxy ->StartingSwarmManager ->StartingSwarmAgent NodeaddedtoSwarm:192.168.190.148 本文转自 sjfbjs 51CTO博客,原文链接:http://blog.51cto.com/11886896/1878435

优秀的个人博客,低调大师

Android UI开发第十七篇——Android Fragment实例

TitlesFragment TitlesFragment继承自Fragment的子类ListFragment,使用了一个静态数组填充列表,重写了onListItemClick方法,showDetails方法展示ListView item的详情。 DetailsFragment df = DetailsFragment.newInstance(index);//获取详情Fragment的实例 FragmentTransaction ft = getFragmentManager().beginTransaction();//获取FragmentTransaction 实例 ft.replace(R.id.details, df); //使用DetailsFragment 的实例 ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.commit();//提交 这里就使用到了Android Fragment使用中介绍的第二种加载fragment的方法。看一下DetailsFragment : 布局文件中使用了fragment标签和FrameLayout标签。Android Fragment使用中介绍了2中嵌入Fragment的方法,这个实例中都用到,从布局文件看到有了fragment标签,这是一种使用方法,FrameLayout标签将会成为第二种加载fragment的载体view。 看一下程序实现(com.fragment.main.TitlesFragment): 效果图的左边是一个列表,右边是列表item的详情。 先看一下布局文件(layout): Fragment是Android honeycomb 3.0新增的概念,在Android——Fragment介绍、Android Fragment使用、Android FragmentManage FragmentTransaction介绍中做了关于Fragment的详细介绍。这一片主要通过一个实例了解Fragment的使用。 先看下实例效果图: 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817249,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android UI开发第九篇——SlidingDrawer 抽屉效果

SlidingDrawer是自SDK 1.5才新加入的,实现Launcher的抽屉效果。SlidingDrawer配置上采用了水平展开或垂直展开两种(android:orientation)方式,在XML里必须指定其使用的android:handle与android:content,前者委托要展开的图片(Layout配置),后者则是要展开的Layout Content。 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/i1" > <SlidingDrawer android:id="@+id/slidingdrawer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:handle="@+id/handle" android:content="@+id/content"> <Button android:id="@+id/handle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/ic_dialog_dialer" /> <LinearLayout android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/default_bg"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <EditText android:id="@+id/editText" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> </SlidingDrawer> </LinearLayout> 补充: 一、简介 SlidingDrawer隐藏屏外的内容,并允许用户通过handle以显示隐藏内容。它可以垂直或水平滑动,它有俩个View组成,其一是可以拖动的handle,其二是隐藏内容的View.它里面的控件必须设置布局,在布局文件中必须指定handle和content. 例如下面 <SlidingDrawer android:layout_width="fill_parent" android:layout_height="fill_parent" android:handle="@+id/handle" android:content="@+id/content" android:orientation="vertical" android:id="@+id/slidingdrawer"> <ImageButton android:id="@id/handle" android:layout_width="50dip" android:layout_height="44dip" android:src="@drawable/up" /> <LinearLayout android:id="@id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <TextView android:text="这是一个滑动式抽屉的示例" android:id="@+id/tv" android:textSize="18px" android:textColor="#000000" android:gravity="center_vertical|center_horizontal" android:layout_width="match_parent" android:textStyle="bold" android:layout_height="match_parent"></TextView> </LinearLayout> </SlidingDrawer> 二、重要属性 android:allowSingleTap:指示是否可以通过handle打开或关闭 android:animateOnClick:指示是否当使用者按下手柄打开/关闭时是否该有一个动画。 android:content:隐藏的内容 android:handle:handle(手柄) 三、重要方法 animateClose():关闭时实现动画。 close():即时关闭 getContent():获取内容 isMoving():指示SlidingDrawer是否在移动。 isOpened():指示SlidingDrawer是否已全部打开 lock():屏蔽触摸事件。 setOnDrawerCloseListener(SlidingDrawer.OnDrawerCloseListener onDrawerCloseListener):SlidingDrawer关闭时调用 unlock():解除屏蔽触摸事件。 toggle():切换打开和关闭的抽屉SlidingDrawer。 四、完整实例 1.布局文件slidingdrawer.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/default_bg"> <SlidingDrawer android:layout_width="fill_parent" android:layout_height="fill_parent" android:handle="@+id/handle" android:content="@+id/content" android:orientation="vertical" android:id="@+id/slidingdrawer"> <ImageButton android:id="@id/handle" android:layout_width="50dip" android:layout_height="44dip" android:src="@drawable/up" /> <LinearLayout android:id="@id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <TextView android:text="这是一个滑动式抽屉的示例" android:id="@+id/tv" android:textSize="18px" android:textColor="#000000" android:gravity="center_vertical|center_horizontal" android:layout_width="match_parent" android:textStyle="bold" android:layout_height="match_parent"></TextView> </LinearLayout> </SlidingDrawer> </LinearLayout> 2.Java代码 package com.wjq; import android.app.Activity; import android.os.Bundle; import android.widget.ImageButton; import android.widget.SlidingDrawer; import android.widget.TextView; public class SlidingDrawerDemo extends Activity { private SlidingDrawer mDrawer; private ImageButton imbg; private Boolean flag=false; private TextView tv; /* (non-Javadoc) * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.sildingdrawer); imbg=(ImageButton)findViewById(R.id.handle); mDrawer=(SlidingDrawer)findViewById(R.id.slidingdrawer); tv=(TextView)findViewById(R.id.tv); mDrawer.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener() { @Override public void onDrawerOpened() { flag=true; imbg.setImageResource(R.drawable.down); } }); mDrawer.setOnDrawerCloseListener(new SlidingDrawer.OnDrawerCloseListener(){ @Override public void onDrawerClosed() { flag=false; imbg.setImageResource(R.drawable.up); } }); mDrawer.setOnDrawerScrollListener(new SlidingDrawer.OnDrawerScrollListener(){ @Override public void onScrollEnded() { tv.setText("结束拖动"); } @Override public void onScrollStarted() { tv.setText("开始拖动"); } }); } } 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817346,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android UI开发第二篇——多级列表(ExpandableListView)

开发中很多地方使用到了多级列表,android可以使用ExpandableListView很好的实现,下面模仿了手机qq的实现,见下图。 多级列表使用了ExpandableListView,自定义了Adapter; 代码可以到 http://www.devdiv.com/viewthread.php?tid=39473&extra= 下载 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817392,如需转载请自行联系原作者

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册