Blog Fragment in Navigation Drawer with Tabs

This replaces the custom layouts in the navigation drawer with a
`NavigationView` and adds a menu entry for Blogs.

A Main Blogs fragment is added that holds a `TabLayout` and a
`ViewPager`. Five tabs are already added, but they just have a single
placeholder fragment that is to be replaced by the actual fragments.

Closes #409
This commit is contained in:
Torsten Grote
2016-06-02 19:06:53 -03:00
parent bba7083660
commit 3f838b0472
40 changed files with 410 additions and 109 deletions

View File

@@ -0,0 +1,55 @@
package org.briarproject.android.blogs;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.briarproject.R;
import org.briarproject.android.fragment.BaseFragment;
import java.util.logging.Logger;
import javax.inject.Inject;
public class MyBlogsFragment extends BaseFragment {
public final static String TAG = MyBlogsFragment.class.getName();
@Inject
public MyBlogsFragment() {
}
static MyBlogsFragment newInstance(int num) {
MyBlogsFragment f = new MyBlogsFragment();
Bundle args = new Bundle();
args.putInt("num", num);
f.setArguments(args);
return f;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_blogs_my, container,
false);
TextView numView = (TextView) v.findViewById(R.id.num);
String num = String.valueOf(getArguments().getInt("num"));
numView.setText(num);
return v;
}
@Override
public String getUniqueTag() {
return TAG;
}
}