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
package comtas.com.zoolvibs.helper; | |
import android.support.animation.DynamicAnimation; | |
import android.support.animation.SpringAnimation; | |
import android.view.View; | |
/** | |
* Created by m7mdra on 08/10/17. | |
*/ |
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
package comtas.com.zoolvibs.network; | |
import javax.annotation.Nullable; | |
/** | |
* Created by m7mdra on 23/12/17. | |
*/ | |
public interface Resource<T> { |
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
private String saveImageByUri(Uri uri) { | |
File parent = new File(getCacheDir(), "temp_images"); | |
try { | |
final InputStream inputStream = getContentResolver().openInputStream(uri); | |
if (inputStream == null) | |
return ""; | |
final BufferedSource source = Okio.buffer(Okio.source(inputStream)); | |
//create file named with same format temp24734194048114480959349.png | |
final File file = File.createTempFile(String.format(Locale.ENGLISH, "temp%d", SystemClock.currentThreadTimeMillis()), ".png", parent); | |
final Sink sink = Okio.sink(file); |
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
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="36dp" | |
android:height="36dp" | |
android:autoMirrored="true" | |
android:viewportWidth="24.0" | |
android:viewportHeight="24.0"> | |
<path | |
android:fillColor="#fff" | |
android:pathData="M10,16.5l6,-4.5 -6,-4.5v9zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" /> | |
</vector> |
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.app.Activity | |
import android.graphics.Color | |
import android.graphics.Paint | |
import android.os.Bundle | |
import android.support.v7.widget.SearchView | |
import android.text.SpannableString | |
import android.text.style.BackgroundColorSpan | |
import android.util.Log | |
import kotlinx.android.synthetic.main.activity_main.* |
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
val spanned = spannable{ bold("some") + italic(" formatted") + color(Color.RED, " text") } | |
val nested = spannable { italic(underline(bold(size(2f, color(Color.RED, "Red Bold Color"))))) } | |
val noWrapping = bold("no ") + sub("wrapping ) + sup("also ") + "works" | |
text_view.text = spanned + nested + noWrapping |
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
public class BaseActivity extends AppCompatActivity { | |
private ProgressDialog progressDialog; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
progressDialog = new ProgressDialog(this); | |
progressDialog.setTitle("Title here"); |
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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.m7mdra.copythat"> | |
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> | |
<application | |
android:name=".App" | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
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
{"version":8,"name":"THTC Maps Style default","sources":{"thtcmaps":{"type":"vector","url":"https://ksamaps.com/api/tilejson"}},"sprite":"https://ksamaps.com/assets/sprite","glyphs":"https://ksamaps.com/fonts/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","paint":{"background-color":"#aadaff"}},{"id":"land_fine","type":"fill","source":"thtcmaps","source-layer":"land_fine","layout":{"visibility":"visible"},"paint":{"fill-color":"#eeece6"}},{"id":"terrain","minzoom":4,"maxzoom":13,"type":"line","source":"thtcmaps","source-layer":"gcc_terrain","paint":{"line-color":"#dbc688","line-opacity":{"base":1,"stops":[[4,0.5],[18,0.1]]},"line-width":{"base":1,"stops":[[4,0.25],[18,0.75]]}}},{"id":"countryborder","type":"line","source":"thtcmaps","source-layer":"land","maxzoom":7,"layout":{"visibility":"visible"},"paint":{"line-color":"#bdbec2","line-width":0.5}},{"id":"provinces","type":"line","source":"thtcmaps","source-layer":"provinces","layout":{"visibility":"visible"},"paint":{"line-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
typealias BindCallback<T, ViewHolder> = (ViewHolder, T, Int) -> Unit | |
typealias ViewHolderCreate<ViewHolder> = (ViewGroup) -> ViewHolder | |
typealias ClickCallback<T> = (Int, T) -> Unit | |
class SimpleList<T, ViewHolder : RecyclerView.ViewHolder>( | |
private val list: List<T>, | |
private val viewHolderCreate: ViewHolderCreate<ViewHolder>, | |
private val bindCallback: BindCallback<T, ViewHolder>? = null, | |
private val clickCallback: ClickCallback<T>? = null |