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
// original link https://chrisbanes.me/posts/measuring-text/ | |
public void drawTextOnCenterOfBounds() { | |
int mTextWidth, mTextHeight; // Our calculated text bounds | |
Paint mTextPaint = new Paint(); | |
// Now lets calculate the size of the text | |
Rect textBounds = new Rect(); | |
mTextPaint.getTextBounds(mText, 0, mText.length(), textBounds); |
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 de.markusfisch.android.textrect.widget; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.view.View; | |
import de.markusfisch.android.textrect.graphics.TextRect; |
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
<ScrollView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layoutAnimation="@anim/layout_animation" | |
android:orientation="vertical"> | |
</ScrollView> |
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
# this code for delete build directory from folder where file is run | |
# this will delete directory and more to Trash in MacOs | |
# WARNING : check directory before delete | |
import os | |
from send2trash import send2trash | |
def find_build_directories(root_dir): | |
build_dirs = [] |
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.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.graphics.Path | |
import android.util.AttributeSet | |
import android.view.View | |
class TransparentGridRectView @JvmOverloads constructor( |
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.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.util.AttributeSet | |
import android.view.View | |
class TransparentGridLinesView @JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyle: Int = 0 |
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 com.google.gson.Gson | |
import com.google.gson.JsonSyntaxException | |
import java.io.BufferedReader | |
import java.io.File | |
import java.io.FileReader | |
import java.io.IOException | |
class GsonEx { | |
companion object { |
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
# refrence from https://stackoverflow.com/questions/76439814/android-using-new-version-catalog-to-add-local-modules | |
# settings.gradle | |
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") | |
rootProject.name = "MyApplication" | |
include(":app") | |
include(":library_module") | |
# build.gradle of project where you add |
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
// https://medium.com/@mirzahssn/create-aar-file-in-android-e1ff009ba899 | |
To create AAR | |
you need to Rebuild Project using android studio OR | |
just type command in terminal | |
./gradlew build | |
./gradlew assemble |
NewerOlder