mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
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
56 lines
1.1 KiB
Java
56 lines
1.1 KiB
Java
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;
|
|
}
|
|
|
|
}
|