mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user