This file contains hidden or 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 RecyclerViewAdapter extends RecyclerView.Adapter<DataObjectHolder> { | |
public RecyclerViewAdapter() { | |
} | |
@Override | |
public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { | |
Timber.i("onCreateViewHolder"); | |
View view = new ChatItemView(parent.getContext()); |
This file contains hidden or 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:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
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 hidden or 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
{ | |
"name": "Anirut Teerabut", | |
"company": "IBS", | |
"blog": null, | |
} |
This file contains hidden or 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
depedencies{ | |
//retrofit2 | |
compile 'com.squareup.retrofit2:retrofit:2.2.0' | |
//gson converter by retrofit | |
compile 'com.squareup.retrofit2:converter-gson:2.2.0' | |
} |
This file contains hidden or 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
@FormUrlEncoded | |
@POST(global-file/check-version.php) | |
Call<SplashModel> getData(@Field("app_name") String app_name); |
This file contains hidden or 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 interface GitHubService { | |
@GET("/users/{username}") | |
Call<User> getUser(@Path("username") String username); | |
} |
This file contains hidden or 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
private LinearLayout layoutForm; | |
private LinearLayout layoutProgress; | |
private LinearLayout layoutResult; | |
private EditText edUsername; | |
private Button btSend; | |
private TextView tvResult; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
setContentView(); |
This file contains hidden or 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 void onClick(View v) { | |
//แสดง layout progress (ควรแยกไปอีก method ชื่อว่า showLoading()) | |
layoutForm.setVisibility(View.GONE); | |
layoutResult.setVisibility(View.GONE); | |
layoutProgress.setVisibility(View.VISIBLE); | |
new NetworkConnectionManager().callServer(networkCallbackListener, edUsername.getText().toString()); | |
} |
This file contains hidden or 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
View.OnClickListener onBtSendClickListener = new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
} | |
}; |
This file contains hidden or 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
OnNetworkCallbackListener networkCallbackListener = new OnNetworkCallbackListener() { | |
@Override | |
public void onResponse(User user, Retrofit retrofit) { | |
//200 | |
} | |
@Override | |
public void onBodyError(ResponseBody responseBodyError) { | |
//404 (error not null) |
OlderNewer