View SampleWebView.java
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
private void initWebView(final String linkURL) { | |
pDialog.show(); | |
mWebView = (WebView) findViewById(R.id.content_webview); | |
mWebView.getSettings().setJavaScriptEnabled(true); | |
mWebView.loadUrl(linkURL); | |
mWebView.setWebChromeClient(new WebChromeClient() { | |
public boolean onShowFileChooser( | |
WebView webView, ValueCallback<Uri[]> filePathCallback, | |
WebChromeClient.FileChooserParams fileChooserParams) { |
View Example
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
// java file : | |
if (email.isEmpty() || !android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) { | |
_emailText.setError("enter a valid email address"); | |
valid = false; | |
} | |
// xmlnya : | |
<!-- Email Label --> | |
<android.support.design.widget.TextInputLayout |
View SampleLayout.xml
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="fill_parent" | |
android:layout_height="match_parent" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:background="@drawable/cover" | |
android:orientation="vertica"> <--! dibuat vertical, ini root layout --> |
View SampleParameterVolley.java
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 void orderCart(final String idCustomer, final String cartId, final String addressInvoice, final String addressDelivery, final String carrierId, final String paymentMethod) { | |
progressDialog.show(); | |
String urlOrderCart = StaticRegisterClass.urlOrder; | |
StringRequest postReq = new StringRequest(Request.Method.POST, | |
urlOrderCart, | |
createMyReqSuccessListenerOrder(), | |
createMyReqErrorListener()) { | |
protected Map<String, String> getParams() throws com.android.volley.AuthFailureError { | |
Map<String, String> params = new HashMap<String, String>(); |
View ListClass.json
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_name" : "XI IPA 1", | |
"class_subject" : "Biologi" | |
}, | |
{ | |
"class_name" : "9 C", | |
"class_subject" : "Matematika" | |
} | |
] |
View Sampleview.java
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
private RelativeLayout drawInsideEditor; | |
@Bind(R.id.dp_main_layout) | |
RelativeLayout mainLayout; | |
// oncreate | |
drawInsideEditor = (RelativeLayout) View.inflate(this, R.layout.dp_text_editor_layout, null); | |
mainLayout.addView(drawInsideEditor); | |
RelativeLayout drawText = (RelativeLayout) View.inflate(this, R.layout.dp_item_textview_preview, null); |
View MyApp.java
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 MyApp extends Application { | |
@Override | |
public void onCreate() { | |
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf | |
} | |
} |
View Android unzip file using ZipInputStream
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 unzip extends Activity { | |
/** Called when the activity is first created. */ | |
static final int BUFFER = 2048; | |
TextView textView; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
textView = new TextView(this); |
View CustomTextView.java
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
package dummy.protophonto.utilAndHelper; | |
/** | |
* Created on : January 20, 2016 | |
* Author : mnafian | |
* Name : M. Nafian | |
* Email : mnafian@icloud.com | |
* GitHub : https://github.com/mnafian | |
* LinkedIn : https://id.linkedin.com/in/mnafian | |
* Company : Inagata Technosmith |
View RevisionCustomTextView.java
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
package dummy.protophonto.utilAndHelper; | |
/** | |
* Created on : January 20, 2016 | |
* Author : mnafian | |
* Name : M. Nafian | |
* Email : mnafian@icloud.com | |
* GitHub : https://github.com/mnafian | |
* LinkedIn : https://id.linkedin.com/in/mnafian | |
* Company : Inagata Technosmith |
OlderNewer