Add gutter icons for Android resource references

#KT-16843 Fixed
This commit is contained in:
Vyacheslav Gerasimov
2017-04-26 18:08:11 +03:00
parent 386ec53dd5
commit 49c8dfbb06
18 changed files with 650 additions and 44 deletions
+18
View File
@@ -0,0 +1,18 @@
package com.myapp;
public final class R {
public static final class drawable {
public static final int test_icon=0x7f02005d;
}
public static final class mipmap {
public static final int test_icon=0x7f04005d;
}
public static final class color {
public static final int colorAccent=0x7f0a0013;
public static final int colorPrimary=0x7f0a0014;
public static final int colorPrimaryDark=0x7f0a0015;
}
public static final class layout {
public static final int activity_kotlin=0x7f08005d;
}
}
+6
View File
@@ -0,0 +1,6 @@
// COLOR: FF,40,81
package com.myapp
import android.content.Context
<caret>fun Context.getPrimaryColor() = resources.getColor(R.color.colorAccent, null)
+6
View File
@@ -0,0 +1,6 @@
// DRAWABLE
package com.myapp
import android.content.Context
<caret>fun Context.getAddIcon() = resources.getDrawable(R.drawable.test_icon, null)
+6
View File
@@ -0,0 +1,6 @@
// DRAWABLE
package com.myapp
import android.content.Context
<caret>fun Context.getAddIcon() = resources.getDrawable(R.mipmap.test_icon, null)
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_kotlin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin">
</RelativeLayout>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
+4
View File
@@ -0,0 +1,4 @@
// COLOR: 0,0,0
import android.content.Context
<caret>fun getBlackColor() = android.R.color.black
+4
View File
@@ -0,0 +1,4 @@
// DRAWABLE
import android.content.Context
fun <caret>Context.getAddIcon() = resources.getDrawable(android.R.drawable.ic_menu_add, null)