Я пытаюсь создать Renderable View с текстовым представлением. Я создаю несколько копий одного и того же RendrableView. Когда я пытаюсь изменить текст в любом из представляемых представлений, изменение отражается во всех представлениях. Кто-нибудь может мне помочь в этом контексте?
Фрагмент кода:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/txts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light"
android:padding="4dp">
<TextView
android:id="@+id/dimentionsTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" />
</LinearLayout>
И Android-код:
private void createTxtNode(Node parent, String value)
{
Node dimentionNode = new Node();
dimentionNode.setParent(parent);
dimentionNode.setRenderable(dimentionsRenderableView.makeCopy());
dimentionNode.setLocalPosition(Vector3.zero());
dimentionNode.setLookDirection(c.getForward());
dimentionNode.setLocalScale(new Vector3(0.1f,0.1f,0.1f));
ViewRenderable r = (ViewRenderable)dimentionNode.getRenderable();
View v = r.getView();
TextView dimention = v.findViewById(R.id.dimentionsTxt);
dimention.setText(value);
}
Фактический объем производства:
Если у меня 2 Renderable Views,
Когда я добавляю 1-й вид 14 mtrs.
2-й визуализируемый вид:
12 месяцев, 12 месяцев. Означает, что 14 mtrs заменено на 12 mtrs.
Ожидаемый результат:
14 метров, 12 месяцев.