Skip to content

Instantly share code, notes, and snippets.

Rahmad Setiawan Mukminullah NaturalizerINA

Block or report user

Report or block NaturalizerINA

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@NaturalizerINA
NaturalizerINA / ItemDecoration.java
Created Jul 6, 2019
This is the way, how to make grid decoration
View ItemDecoration.java
//the function of this class is for customing and creating padding or margin for the recyclerview
public class RecyclerViewMargin extends RecyclerView.ItemDecoration {
//column is for accomodate the number of columns
int columns;
//margin is for accomodate the size of margin
int margin;
public RecyclerViewMargin(int margin, int columns) {
//passing the margin from margin that defined outside to inside
@NaturalizerINA
NaturalizerINA / CustomDialog.java
Created Jul 6, 2019
This is the way how to make an custom dialog
View CustomDialog.java
package com.mukminullah.ecommerce;
import android.app.Dialog;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Window;
import android.view.WindowManager;
@NaturalizerINA
NaturalizerINA / RestoringActivityInstanceState.java
Created Mar 30, 2019
this is example of save instance state in activity 2
View RestoringActivityInstanceState.java
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString("reply_text", mReplyTextView.getText().toString());
}
@NaturalizerINA
NaturalizerINA / SaveInstanceExample.java
Created Mar 30, 2019
this is example of save instance state in activity 1
View SaveInstanceExample.java
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString("reply_text", mReplyTextView.getText().toString());
}
View MainActivity.java
package com.mukminullah.recyclerview;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
View RDV_list.java
package com.mukminullah.recyclerview;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* Created by user on 26/01/18.
*/
View AV_list.java
package com.mukminullah.recyclerview;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
View B_list.java
package com.mukminullah.recyclerview;
/**
* Created by user on 26/01/18.
*/
public class B_list {
private String nama;
private String jurusan;
View item_list.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4f328b"
android:orientation="vertical"
View activity_main.xml
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:background="#fff"
tools:context="com.mukminullah.recyclerview.MainActivity">
<android.support.v7.widget.RecyclerView
You can’t perform that action at this time.