PATCH https://api.bukalapak.com/v2/products/:id/push.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
package daeng.app.test.Permission; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.content.pm.PackageManager; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.content.ContextCompat; | |
import android.widget.Toast; | |
/** |
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 generateImage() { | |
Bitmap src = BitmapFactory.decodeResource(getResources(), R.drawable.img_canvas); //base of image | |
Bitmap dest = Bitmap.createBitmap(src.getWidth(), src.getHeight(), Bitmap.Config.ARGB_8888); | |
String yourText = "Happy Code!"; //content for insert to src. | |
Canvas cs = new Canvas(dest); | |
Paint tPaint = new Paint(); | |
tPaint.setTextSize(40); | |
tPaint.setColor(Color.WHITE); |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "net.mnafian.buildflavorsample" | |
minSdkVersion 16 | |
targetSdkVersion 23 |
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 { | |
@BindView(R.id.btn_load_more) | |
Button btnLoadMore; | |
@BindView(R.id.txt_more) | |
TextView txtMore; | |
boolean showContent = true; | |
@Override |
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
import android.os.AsyncTask; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.UnsupportedEncodingException; | |
import java.util.Arrays; | |
import okhttp3.Call; | |
import okhttp3.Callback; | |
import okhttp3.OkHttpClient; |
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 DrawingView extends View { | |
public int width; | |
public int height; | |
private Bitmap mBitmap; | |
private Canvas mCanvas; | |
private Path mPath; | |
private Paint mBitmapPaint; | |
Context context; | |
private Paint circlePaint; |
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
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import java.lang.reflect.Constructor; | |
import java.util.ArrayList; | |
public abstract class ListAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> { |
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 KeyHash { | |
public static void generateKeyHash(Context context) { | |
try { | |
PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
String something = new String(Base64.encode(md.digest(), 0)); | |
Log.e("Hash key", something); |
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
@Override public void onMapReady(GoogleMap googleMap) { | |
double lat = ((MainActivity) getActivity()).getLat(); // --| terkadang null object reference disini, | |
double lon = ((MainActivity) getActivity()).getLon(); // --| tapi terkadang bisa. | |
LatLng latlong = new LatLng(lat, lon); | |
googleMap.clear(); | |
googleMap.addMarker(new MarkerOptions() | |
.position(latlong) | |
.title("Your Location")); | |
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlong, 16.5f)); | |
} |
OlderNewer