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
// A powerful json parser to make httprequest | |
import android.util.Log; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.io.BufferedInputStream; | |
import java.io.BufferedReader; | |
import java.io.DataOutputStream; | |
import java.io.IOException; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colors from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
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
<?php | |
$items_per_page = 2; | |
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1; | |
$offset = ( $page * $items_per_page ) - $items_per_page; | |
$query = 'SELECT * FROM '.$table_name; | |
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table"; | |
$total = $wpdb->get_var( $total_query ); | |
$results = $wpdb->get_results( $query.' ORDER BY id DESC LIMIT '. $offset.', '. $items_per_page, OBJECT ); | |
/* | |
* |
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
{ | |
"books": [ | |
{ | |
"isbn": "9781593275846", | |
"title": "Eloquent JavaScript, Second Edition", | |
"subtitle": "A Modern Introduction to Programming", | |
"author": "Marijn Haverbeke", | |
"published": "2014-12-14T00:00:00.000Z", | |
"publisher": "No Starch Press", | |
"pages": 472, |
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.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.RectF; | |
import android.os.Build; | |
import android.util.AttributeSet; | |
import android.view.View; |
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.content.Context; | |
import android.util.DisplayMetrics; | |
import android.view.Display; | |
import android.view.WindowManager; | |
public class ScreenUtils { | |
Context ctx; | |
DisplayMetrics metrics; |
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.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.animation.DecelerateInterpolator; | |
import android.widget.Scroller; | |
import androidx.viewpager.widget.ViewPager; | |
import java.lang.reflect.Field; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".BankCardDetailsActivity" | |
android:background="@color/md_white_1000" |
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.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.os.Build; | |
import android.text.Editable; | |
import android.util.AttributeSet; |
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.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Rect; | |
import androidx.annotation.FloatRange; | |
import androidx.annotation.NonNull; | |
import androidx.annotation.Nullable; | |
import androidx.core.view.MarginLayoutParamsCompat; | |
import androidx.core.view.ViewCompat; | |
import androidx.core.widget.NestedScrollView; |
OlderNewer