This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@drawable/border" | |
android:orientation="horizontal"> | |
<TextView | |
android:id="@+id/item_number" | |
android:layout_width="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<stroke android:color="@color/colorAccent" android:width="1dp"/> | |
<corners android:radius="0dp" /> | |
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewPagerFragment extends Fragment { | |
public static final String PAGE_TITLE = "Tab1"; | |
ViewPager viewPager; | |
ViewPagerAdapter viewPagerAdapter; | |
public ViewPagerFragment() { | |
// Required empty public constructor | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
public static final String FRAGMENT_VIEWPAGER = "FRAGMENT_VIEWPAGER"; | |
public static final String FRAGMENT_FIRST = "FRAGMENT_FIRST"; | |
public static final String FRAGMENT_SECOND = "FRAGMENT_SECOND"; | |
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener | |
= new BottomNavigationView.OnNavigationItemSelectedListener() { | |
@Override | |
public boolean onNavigationItemSelected(@NonNull MenuItem item) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context="com.bnviewpager.viewpageriteminbnv.MainActivity"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/checked_text_item" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingLeft="32dp" | |
android:gravity="center_vertical" | |
android:textStyle="bold" | |
android:textSize="14sp" | |
android:checkMark="?android:attr/listChoiceIndicatorSingle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity implements SelectableViewHolder.OnItemSelectedListener { | |
RecyclerView recyclerView; | |
SelectableAdapter adapter; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SelectableAdapter extends RecyclerView.Adapter implements SelectableViewHolder.OnItemSelectedListener { | |
private final List<SelectableItem> mValues; | |
private boolean isMultiSelectionEnabled = false; | |
SelectableViewHolder.OnItemSelectedListener listener; | |
public SelectableAdapter( SelectableViewHolder.OnItemSelectedListener listener, | |
List<Item> items,boolean isMultiSelectionEnabled) { | |
this.listener = listener; |
NewerOlder