Skip to content

Instantly share code, notes, and snippets.

View IslamBesto's full-sized avatar

Nour El Islam SAIDI IslamBesto

  • Paris
View GitHub Profile
package app.toptweets.android.example.com.toptweets;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.util.Log;
@IslamBesto
IslamBesto / Tweet
Last active August 29, 2015 14:12
Tweet Object
{
"created_at":"Thu Dec 25 22:12:02 +0000 2014",
"entities":{
"hashtags":[
{
"text":"Messi",
"indices":[
0,
6
]
package app.earthquakenews.android.example.com.earthquakenews.data;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
android:orientation="horizontal"
tools:context="app.earthquakenews.android.example.com.earthquakenews.MainActivity">
@IslamBesto
IslamBesto / gist:ac9ff43b7d5287c1cd0a
Created December 31, 2014 01:06
detail_activity
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/weather_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="app.earthquakenews.android.example.com.earthquakenews.DetailActivity"
tools:ignore="MergeRootFrame" />
package app.earthquakenews.android.example.com.earthquakenews;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
{
"private": true,
"devDependencies": {
"browser-sync": "^2.8.2",
"del": "^1.2.1",
"glob": "^5.0.14",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-cache": "^0.3.0",
"gulp-changed": "^1.3.0",
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
//point calculation
mPath.reset();
mPath.moveTo(0, 0);
mPath.lineTo(mFirstCurveStartPoint.x, mFirstCurveStartPoint.y);
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// get width and height of navigation bar
// Navigation bar bounds (width & height)
mNavigationBarWidth = getWidth();
mNavigationBarHeight = getHeight();
// the coordinates (x,y) of the start point before curve
mFirstCurveStartPoint.set((mNavigationBarWidth / 2) - (CURVE_CIRCLE_RADIUS * 2) - (CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the end point after curve
public class CurvedBottomNavigationView extends BottomNavigationView {
public CurvedBottomNavigationView(Context context) {
super(context);
init();
}
public CurvedBottomNavigationView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public CurvedBottomNavigationView(Context context, AttributeSet attrs, int defStyleAttr) {