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 SelectableViewHolder extends RecyclerView.ViewHolder { | |
public static final int MULTI_SELECTION = 2; | |
public static final int SINGLE_SELECTION = 1; | |
CheckedTextView textView; | |
SelectableItem mItem; | |
OnItemSelectedListener itemSelectedListener; | |
public SelectableViewHolder(View view, OnItemSelectedListener listener) { |
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 SelectableItem extends Item{ | |
private boolean isSelected = false; | |
public SelectableItem(Item item,boolean isSelected) { | |
super(item.getName(),item.getSurname()); | |
this.isSelected = isSelected; | |
} | |
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 Item { | |
private String name; | |
private String surname; | |
public Item(String name, String surname) { | |
this.name = name; | |
this.surname = surname; | |
} |
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 { | |
private ViewPager viewPager; | |
private ViewPagerAdapter 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 Step1Presenter extends Presenter { | |
TextView textViewStep1; | |
public Step1Presenter(AppCompatActivity activity, View view) { | |
super(activity, view); | |
} | |
@Override | |
public void onCreateView() { |
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 abstract class Presenter { | |
protected View view; | |
private AppCompatActivity activity; | |
public Presenter(AppCompatActivity activity,View view) { | |
this.activity = activity; | |
this.view = view; | |
onCreateView(); | |
} |
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
class ViewPagerAdapter extends PagerAdapter { | |
private final List<Presenter> mPresenterList = new ArrayList<>(); | |
@Override | |
public boolean isViewFromObject(View view, Object object) { | |
return view == object; | |
} | |
@Override | |
public int getCount() { |
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:orientation="vertical" android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<TextView | |
android:id="@+id/step1_textView" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Step1"/> |
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:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/main_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.v4.view.ViewPager | |
android:id="@+id/viewpager" |
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
@LargeTest | |
@RunWith(AndroidJUnit4.class) | |
public class UserServiceTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<MainActivity>(MainActivity.class) { | |
@Override | |
protected void beforeActivityLaunched() { | |
App application = (App) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext(); | |
TestUserComponent component = DaggerUserServiceTest_TestUserComponent.builder() |