Skip to content

Instantly share code, notes, and snippets.

View shihabmi7's full-sized avatar
🎯
Focusing

Muhammad Shihab Uddin shihabmi7

🎯
Focusing
  • Malaysia
View GitHub Profile
@shihabmi7
shihabmi7 / snippet.txt
Last active December 27, 2017 08:53
Prevent application content from screenshot or screen recording
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}
@shihabmi7
shihabmi7 / WrapContentHeightViewPager.java
Created December 25, 2017 12:37 — forked from egslava/WrapContentHeightViewPager.java
Wrap content height ViewPager (Android)
package org.cnii.layoutloader.ui;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
/**
* Special thanks to Daniel López Lacalle for his response
* (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791)
@shihabmi7
shihabmi7 / Multipart
Last active December 4, 2017 08:24
Volley Singletone Class : Multipart
private void submitNLPInfo(final String nlpInfo) {
VolleyMultipartRequest multipartRequest = new VolleyMultipartRequest(Request.Method.POST, "URL HERE", new Response.Listener<NetworkResponse>() {
@Override
public void onResponse(NetworkResponse response) {
}
}, new Response.ErrorListener() {
@Override
package com.alhikmah.taxidriver.model;
import io.realm.RealmObject;
import io.realm.annotations.Index;
import io.realm.annotations.PrimaryKey;
/**
* Created by Shihab on 11/27/2016.
*/
//With this annotation we are going to hide compiler warnings
@shihabmi7
shihabmi7 / circular layout
Created January 10, 2017 06:13
circular layout
https://hemantvc.blogspot.com/2015/01/circular-layout.html
@shihabmi7
shihabmi7 / MapViewHolder.java
Created January 9, 2017 15:03 — forked from alunsford3/MapViewHolder.java
RecyclerViews with MapViews
public class MapViewHolder extends RecyclerView.ViewHolder {
private MapViewListItemView mMapViewListItemView;
public MapViewHolder(MapViewListItemView mapViewListItemView) {
super(mapViewListItemView);
mMapViewListItemView = mapViewListItemView;
}
public void mapViewListItemViewOnCreate(Bundle savedInstanceState) {
@shihabmi7
shihabmi7 / DividerItemDecoration.java
Last active January 9, 2017 16:16
Recylar View with Divider
package com.passenger.ucabs.adapter;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
@shihabmi7
shihabmi7 / google play service available
Created November 29, 2016 12:55
google play service available
// Checking if Google Play Services Available or not
private boolean isGooglePlayServicesAvailable() {
GoogleApiAvailability googleAPI = GoogleApiAvailability.getInstance();
int result = googleAPI.isGooglePlayServicesAvailable(this);
if(result != ConnectionResult.SUCCESS) {
if(googleAPI.isUserResolvableError(result)) {
googleAPI.getErrorDialog(this, result,
0).show();
}
return false;
@shihabmi7
shihabmi7 / spinner_back.xml
Last active November 1, 2021 11:22
Spinner Backgroud Design with image
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<stroke
android:width="1dp"
android:color="#AAAAAA" />
<corners
@shihabmi7
shihabmi7 / ScrollableActivity.java
Created November 21, 2016 17:36
// How to use Location Service :) Follow carefully..
package com.alhikmah.weather360.activity;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.location.Location;
import android.os.Bundle;