Skip to content

Instantly share code, notes, and snippets.

View jedsada-gh's full-sized avatar
😄
undefined

Jedsada Tiwongvorakul jedsada-gh

😄
undefined
View GitHub Profile
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
UserModel user = new UserModel();
public class Student extends RealmObject {
@PrimaryKey
private int studentId;
private String firstName;
private String lastName;
private int age;
private String gender;
private String city;
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
binding = CustomViewGroupBinding.inflate(inflater, this, true);
android {
...
productFlavors {
dev {
applicationId "com.example.www.dev"
buildConfigField 'String', 'SEVER', '"https://api.for_dev.com/"'
}
staging {
applicationId "com.example.www.staging"
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21)
public class MainPresenterTest {
@Mock
MainView view;
@Mock
GitHubApi api;
@InjectMocks
MainInteractorImpl interactor;
language: android
jdk: oraclejdk8
notifications:
email: true
branches:
only:
- master
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:gravity="center"
android:orientation="vertical"
android:padding="20dp"
android:visibility="invisible">
<?xml version="1.0" encoding="utf-8"?>
<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/loading_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible" />
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/error_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible">
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context="com.wisdomlanna.www.switcherviewexample.MainActivity">
<include layout="@layout/view_loading" />