Inline items
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package eu.konggdev.strikemaps.ui.element.item;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import eu.konggdev.strikemaps.R;
|
||||
import eu.konggdev.strikemaps.ui.UIComponent;
|
||||
|
||||
public class InlineItem implements UIItem {
|
||||
public String text;
|
||||
|
||||
public InlineItem(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View makeView(UIComponent spawner) {
|
||||
View view = spawner.inflateUi(R.layout.item_inline);
|
||||
((TextView) view.findViewById(R.id.inline)).setText(text);
|
||||
return view;
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -11,6 +11,7 @@ import eu.konggdev.strikemaps.data.helper.FileHelper;
|
||||
import eu.konggdev.strikemaps.map.source.MapSource;
|
||||
import eu.konggdev.strikemaps.map.style.MapStyle;
|
||||
import eu.konggdev.strikemaps.ui.element.item.GenericItem;
|
||||
import eu.konggdev.strikemaps.ui.element.item.InlineItem;
|
||||
import eu.konggdev.strikemaps.ui.element.item.PreviewItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -50,9 +51,9 @@ public class FragmentLayoutContentOfflineMaps extends Fragment implements MainCo
|
||||
LinearLayout sourcesLayout = view.findViewById(R.id.llDownloadContainer);
|
||||
for (MapSource source : sources) {
|
||||
if (!Objects.equals(source.type, "raster"))
|
||||
sourcesLayout.addView(new PreviewItem(source.url, "").makeView(app.getUi()));
|
||||
sourcesLayout.addView(new InlineItem(source.url).makeView(app.getUi()));
|
||||
else
|
||||
sourcesLayout.addView(new PreviewItem(source.tiles.toString(), "").makeView(app.getUi()));
|
||||
sourcesLayout.addView(new InlineItem(source.tiles.toString()).makeView(app.getUi()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:foregroundTint="#FFFFFF">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:text=""
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp"
|
||||
android:drawableEnd="@drawable/ic_arrow_forward"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user