xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical">android:id="@+id/tv_content"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:textSize="25sp"/>
ContentFragment.java:
/**
* Created by Jay on 2015/10/8 0008.
*/publicclassContentFragmentextendsFragment{privateTextView tv_content;@OverridepublicView onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){View view = inflater.inflate(R.layout.fg_content, container,false);
tv_content =(TextView) view.findViewById(R.id.tv_content);String text = getArguments().getString("text");
tv_content.setText(text);return view;}}
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent">android:id="@+id/img_bg"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@mipmap/bg_menu_left"/>
对应的LeftFragment.java:
/**
* Created by Jay on 2015/10/9 0009.
*/publicclassLeftFragmentextendsFragment{privateDrawerLayout drawer_layout;@OverridepublicView onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){View view = inflater.inflate(R.layout.fg_left, container,false);ImageView img_bg =(ImageView) view.findViewById(R.id.img_bg);
img_bg.setOnClickListener(newView.OnClickListener(){@Overridepublicvoid onClick(View v){
getActivity().startActivity(newIntent(getActivity(),OtherActivity.class));
drawer_layout.closeDrawer(Gravity.START);}});return view;}//暴露给Activity,用于传入DrawerLayout,因为点击后想关掉DrawerLayoutpublicvoid setDrawerLayout(DrawerLayout drawer_layout){this.drawer_layout = drawer_layout;}}
右面的Fragment:
布局就三个按钮,点击后替换中间部分的Fragment,布局fg_right.xml代码如下:
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:background="#2F9AF2"android:gravity="center"android:orientation="vertical">
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical">android:id="@+id/tv_content"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:textSize="25sp"/>
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"android:background="#DCDEDB">android:id="@+id/btn_right"android:layout_width="40dp"android:layout_height="40dp"android:layout_centerVertical="true"android:layout_alignParentRight="true"android:background="@drawable/btn_selctor"/>
转:http://stackoverflow.com/questions/18145774/eclipse-an-error-occurred-while-filtering-resources
maven报错:
maven An error occurred while filtering resources
Maven -> Update Proje
在SVN服务控制台打开资源库“SVN无法读取current” ---摘自网络 写道 SVN无法读取current修复方法 Can't read file : End of file found
文件:repository/db/txn_current、repository/db/current
其中current记录当前最新版本号,txn_current记录版本库中版本