Let's say I have the following TextViewin the layout:
<TextView
android:id="@+id/txtLoginError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/sz_12dp"
android:gravity="center"
android:text="@string/foo" />
Is it possible that I am modifying @dimen/sz_12dpto point to a static field in my custom class, for example:
public static class MyDimensions {
public static int topMarginInPixels = 99;
}
Basically I am looking for a way to build the "databind" element for some experiments; instead of loading the view and then changing it in code ( findview, setWeightetc.). I would like during creation to retrieve dimensions from my custom class, it would extract it from R.java.
. , px dp, res/values ββ , , , , , , .