Instantly share code, notes, and snippets.
☄️
I may be slow to respond.
A human being with a soul.Sometimes a programmer.
- Modulbank (@brcportal2)
- SMILEUPPS-4201866254
Firsto /ScaleView.kt
CreatedJanuary 29, 2020 15:06
SImple view to add scale bar in map container layout 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
importandroid.content.Context | |
importandroid.graphics.Canvas | |
importandroid.graphics.Color | |
importandroid.graphics.Paint | |
importandroid.graphics.Paint.Style.FILL | |
importandroid.graphics.Paint.Style.STROKE | |
importandroid.graphics.Path | |
importandroid.graphics.Rect | |
importandroid.util.AttributeSet | |
importandroid.view.View |
Firsto /grayscale_imageview.java
CreatedNovember 6, 2017 12:03 — forked fromnisrulz/grayscale_imageview.java
Apply grayscale filter to ImageView in android 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
ImageViewimgview = (ImageView)findViewById(R.id.imageView_grayscale); | |
imgview.setImageBitmap(bitmap); | |
// Apply grayscale filter | |
ColorMatrixmatrix =newColorMatrix(); | |
matrix.setSaturation(0); | |
ColorMatrixColorFilterfilter =newColorMatrixColorFilter(matrix); | |
imgview.setColorFilter(filter); |
Firsto /OrderListDividerDecorator.java
CreatedJuly 18, 2017 07:52
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
importandroid.content.Context; | |
importandroid.graphics.Canvas; | |
importandroid.graphics.Rect; | |
importandroid.graphics.drawable.Drawable; | |
importandroid.support.v7.widget.RecyclerView; | |
importandroid.view.View; | |
importgb.sweetlifecl.R; | |
publicclassOrderListDividerDecoratorextendsRecyclerView.ItemDecoration { |
Firsto /TableDataDeserializer.java
CreatedJune 14, 2017 13:00
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
importcom.google.gson.JsonArray; | |
importcom.google.gson.JsonDeserializationContext; | |
importcom.google.gson.JsonDeserializer; | |
importcom.google.gson.JsonElement; | |
importcom.google.gson.JsonObject; | |
importcom.google.gson.JsonParseException; | |
importjava.lang.reflect.Type; | |
importjava.util.ArrayList; | |
importjava.util.Collections; |
Firsto /SchedulerProvider.java
CreatedJune 14, 2017 11:30
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
importrx.Scheduler; | |
publicclassSchedulerProvider { | |
privatefinalSchedulersubscribeOn; | |
privatefinalSchedulerobserveOn; | |
publicSchedulerProvider(SchedulersubscribeOn,SchedulerobserveOn) { | |
this.subscribeOn =subscribeOn; | |
this.observeOn =observeOn; |
Firsto /RxPresenter.java
Last activeJune 14, 2017 11:27
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
importcom.arellomobile.mvp.MvpPresenter; | |
importcom.arellomobile.mvp.MvpView; | |
importgb.sweetlifecl.di.module.SchedulerProvider; | |
importrx.Completable; | |
importrx.Observable; | |
importrx.Single; | |
importrx.Subscription; | |
publicabstractclassRxPresenter<VextendsMvpView>extendsMvpPresenter<V> { |
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
classBuildingImageAdapterextendsFastItemAdapter<BuildingImageItem> { | |
@Override | |
publicintgetAdapterItemCount() { | |
returnInteger.MAX_VALUE; | |
} | |
@Override | |
publicvoidonBindViewHolder(RecyclerView.ViewHolderholder,intposition) { | |
position =position %getItemAdapter().getAdapterItems().size(); | |
super.onBindViewHolder(holder,position); |
Firsto /AwesomeUniversalUltimatePhoneTextWatcher.java
CreatedMarch 23, 2017 06:30
textwatcher to format russian phone numbers like +7 800 555 4444 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
packageru.firsto.testtesttest.ui.activity.auth; | |
importandroid.text.Editable; | |
importandroid.text.TextWatcher; | |
/** | |
* @author razor | |
* @created 23.03.17 | |
**/ |
Firsto /keybase.md
CreatedMarch 16, 2016 13:59
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 java.util.Scanner; | |
public class Main{ | |
public static void main(String []args){ | |
Scanner sc = new Scanner(System.in); | |
String mn = sc.nextLine(); |