Im trying to add a vertical divider in chipgroup to separate primary chip from other chips. Just like YouTube:
I have attempted to add it through this method. In the Activity:
<HorizontalScrollView
android:id="@+id/hscroll_categories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
android:scrollbars="none">
<com.google.android.material.chip.ChipGroup
android:id="@+id/chipgroup_categories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:orientation="horizontal"
app:singleSelection="true"
app:selectionRequired="true"
app:singleLine="true" />
</HorizontalScrollView>
Run Code Online (Sandbox Code Playgroud)
item_chip_category.xml:
<com.google.android.material.chip.Chip xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
app:chipStartPadding="18dp"
app:chipEndPadding="18dp"
app:chipMinHeight="40dp"
android:textColor="@color/txt_category_chip_light"
app:chipBackgroundColor="@color/bg_category_chip_light"
app:chipStrokeWidth="1dp"
app:chipStrokeColor="@color/stroke_category_chip_light"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:textAppearance="?android:attr/textAppearance" />
Run Code Online (Sandbox Code Playgroud)
vertical_div.xml:
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#424242"/>
Run Code Online (Sandbox Code Playgroud)
And adding the chips and divider dynamically:
Chip …
Run Code Online (Sandbox Code Playgroud) 我想在 PHP 中验证 URI (不仅仅是 URL),但找不到任何方法来做到这一点。
PHP 确实有parse_url()
,但它不适用于 URI,找到一种正确的方法来验证 URI 结构会很有帮助,如下所示:
content://com.example.provider/articles/?optional=queries
Run Code Online (Sandbox Code Playgroud)