To do this in Android Studio go to Preferences > Editor > Code Style
and set Right margin (columns) to 150 (or the line width you want)
Now go to File -> Settings > Editor > Code Style > Java > Wrapping and Braces
| import androidx.animation.IntToVectorConverter | |
| import androidx.animation.tween | |
| import androidx.compose.Composable | |
| import androidx.compose.mutableStateOf | |
| import androidx.compose.remember | |
| import androidx.ui.animation.animatedFloat | |
| import androidx.ui.animation.animatedValue | |
| import androidx.ui.core.* | |
| import androidx.ui.core.gesture.scrollorientationlocking.Orientation | |
| import androidx.ui.foundation.animation.FlingConfig |
| val selectedSubcategories = selectedCategories.asSequence().map { it?.subCategories }.fold(mutableSetOf<SubCategoryModel>()) { acc, list -> | |
| list?.asSequence()?.filter { it.checked }?.map { acc.add(it) }?.toList() | |
| acc | |
| } | |
| val subcategoriesJoined = selectedSubcategories.asSequence().map { it.name }.joinToString(separator = " • ") | |
| editTextProfessionalRegisterCategories.setText(subcategoriesJoined) |
| // 1. | |
| class LocationActivity : AppCompatActivity(), OnMapReadyCallback { | |
| // 2. | |
| private var mLocationRequest: LocationRequest? = null | |
| private val UPDATE_INTERVAL = (10 * 1000).toLong() /* 10 secs */ | |
| private val FASTEST_INTERVAL: Long = 2000 /* 2 sec */ | |
| private var latitude = 0.0 | |
| private var longitude = 0.0 |
| package im.ene.lab.android.widgets; | |
| import android.content.Context; | |
| import android.graphics.PorterDuff; | |
| import android.graphics.drawable.Drawable; | |
| import android.os.Build; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.design.widget.TabLayout; | |
| import android.util.AttributeSet; |
use the build in sizes like @dimen/text_size_body_2_material or style/TextAppearance.Material.Headline.
Simple helper file for standard text sizes in material design. The sizes are provided by the material design documentation https://www.google.com/design/spec/style/typography.html#typography-roboto
| public class MyApp extends Application { | |
| @Override | |
| public void onCreate() { | |
| TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf | |
| } | |
| } |