🏃♂️
This file contains hidden or 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
fun String.toSpanned(): Spanned { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
return Html.fromHtml(this, Html.FROM_HTML_MODE_LEGACY) | |
} else { | |
@Suppress("DEPRECATION") | |
return Html.fromHtml(this) | |
} | |
} |
This file contains hidden or 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
fun FragmentManager.show(containerId: Int, fragment: Fragment, backstack: String? = null) { | |
beginTransaction() | |
.replace(containerId, fragment) | |
.addToBackStack(backstack) | |
.commit() | |
} |
This file contains hidden or 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 static void showKeyboard(final Activity activity, final View view) { | |
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); | |
inputMethodManager.toggleSoftInputFromWindow( | |
view.getApplicationWindowToken(), | |
InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_NOT_ALWAYS); | |
} |
This file contains hidden or 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
require 'nokogiri' | |
File.open("/your/file/path/test.svg", "r") do |f| | |
@doc = Nokogiri::XML(f) | |
puts "\n\n\n" | |
puts @doc.css("path").first.attr("d") | |
puts "\n\n\n" | |
end |
This file contains hidden or 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 void makeBlur(ImageView imageview) { | |
BitmapDrawable drawable = (BitmapDrawable) imageview.getDrawable(); | |
Bitmap bitmap = drawable.getBitmap(); | |
textView.setText("Radius: " + "" + radiusArr[position]); | |
Bitmap blurred = blurRenderScript(bitmap, 25); //second parametre is radius max:25 | |
imageview.setImageBitmap(blurred); //radius decide blur amount | |
} | |
@SuppressLint("NewApi") | |
private Bitmap blurRenderScript(Bitmap smallBitmap, int radius) { |