Skip to content

Instantly share code, notes, and snippets.

View IslamBesto's full-sized avatar

Nour El Islam SAIDI IslamBesto

  • Paris
View GitHub Profile
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawPath(mPath, mPaint);
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false">
<com.example.saidi.foodesto.views.CurvedBottomNavigationView
android:id="@+id/curve_bottom_navigation_view"
android:layout_width="match_parent"
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) {
@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
@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);
{
"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",
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;
@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" />
<?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">
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;