Skip to content

Instantly share code, notes, and snippets.

View rygelouv's full-sized avatar

Rygel Louv rygelouv

View GitHub Profile
@rygelouv
rygelouv / edittext_border.xml
Created December 23, 2015 17:23
Use this drawable as background to get an Android EditText with border.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:thickness="0dp"
android:shape="rectangle">
<stroke android:width="1dp"
android:color="@color/divider"/>
<corners android:radius="0dp" />
</shape>
@rygelouv
rygelouv / cicler_background_gray.xml
Created December 23, 2015 17:29
A drawable xml file to get a circle background on a view on Android.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<gradient
android:startColor="@color/background"
android:endColor="@color/background"
android:angle="270"/>
</shape>
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rygelouv
rygelouv / activity_main2.xml
Created February 12, 2016 17:42
Activity with drawerlayout and viewpager
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
@rygelouv
rygelouv / Message.java
Created April 10, 2016 16:03
Class message for pubnub
package fr.koonda.koonda.koondamessagerie.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by rygel on 11/12/15.
*/
public class Message
{
@rygelouv
rygelouv / urls.py
Created April 27, 2016 13:41
the fu***g urls.py
"""digitalmarket URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
@rygelouv
rygelouv / ColorUtils.java
Last active July 21, 2017 11:08
Generate random colors for ImageView placholder
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.v4.graphics.drawable.DrawableCompat;
import com.devengine.paladin.coinafrique.R;
import java.util.ArrayList;
import java.util.Random;
public class ColorUtils
@rygelouv
rygelouv / EachDirectoryPath.md
Created March 12, 2018 11:30 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

class TextMultiStateView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr)
class TextMultiStateView: LinearLayout
{
lateinit var text: TextView
lateinit var progress: ProgressBar
lateinit var image: ImageView
constructor(context: Context) : super(context){
init(context)
}