This file contains hidden or 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.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
public class EmptyRecyclerView extends RecyclerView { | |
@Nullable View emptyView; |
This file contains hidden or 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.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; | |
import android.widget.TextView; | |
/** | |
* Created by khaled bakhtiari on 10/26/2014. | |
* <a href="http://about.me/kh.bakhtiari"> | |
*/ |
This file contains hidden or 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.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |
This file contains hidden or 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 | |
$message = array("Alert! EarthQuake is likely to occur within 15 mins.", "Hi! from Manish", "Wassup ?"); | |
$pos =mt_rand(0,count($message)); | |
$api_url = "http://api.sparrowsms.com/v2/sms/?". | |
http_build_query(array( | |
'token' => 'QRtl8w1FQvlVqcrWrkHv ', |
This file contains hidden or 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 LoggingExceptionHandler implements java.lang.Thread.UncaughtExceptionHandler { | |
@Override | |
public void uncaughtException(Thread thread, Throwable ex) { | |
StringWriter stackTrace = new StringWriter(); | |
ex.printStackTrace(new PrintWriter(stackTrace)); | |
String msg = "WALT crashed with the following exception:\n" + stackTrace; | |
// Fire a new activity showing the stack trace | |
Intent intent = new Intent(MainActivity.this, CrashLogActivity.class); |
This file contains hidden or 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 info.androidhive.volleyexamples.app; | |
import info.androidhive.volleyexamples.volley.utils.LruBitmapCache; | |
import android.app.Application; | |
import android.text.TextUtils; | |
import com.android.volley.Request; | |
import com.android.volley.RequestQueue; | |
import com.android.volley.toolbox.ImageLoader; | |
import com.android.volley.toolbox.Volley; |
This file contains hidden or 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 com.manishm.popularmovies.ui.activity; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import com.manishm.popularmovies.R; | |
import com.manishm.popularmovies.adapter.LoadsheddingAdapter; | |
import com.manishm.popularmovies.model.Loadshedding; |
This file contains hidden or 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
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/drawer_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
This file contains hidden or 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 PointF calcNextPoint(float theta) { | |
int t = (int) (theta * 1000); | |
float temp = (radius * ct.objMathHelper.Sin[t]); | |
return | |
new PointF( | |
(radius*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]) | |
+ ct.objMathHelper.Cos[t]+ mCenter.x, | |
(radius*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]) | |
-ct.objMathHelper.Sin[t]+ mCenter.y | |
); |
This file contains hidden or 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 PointF calcNextPoint(float theta) { | |
int t = (int) (theta * 1000); | |
float temp = (radius * ct.objMathHelper.Sin[t]); | |
return | |
new PointF(radius*(3*ct.objMathHelper.Sin[t]-4*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t])+mCenter.x | |
,radius*0.6f*ct.objMathHelper.Cos[t]+mCenter.y | |
); | |
} |
OlderNewer