Skip to content

Commit

Permalink
*1、修改设置竖直水平设置
Browse files Browse the repository at this point in the history
  • Loading branch information
dalong982242260 committed May 11, 2016
1 parent 05e484f commit a8896b2
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -83,7 +83,7 @@ private void initLoopRotarySwitchView() {
.setAutoScrollDirection(LoopRotarySwitchView.AutoScrollDirection.left)//切换方向
.setAutoRotationTime(2000);//自动切换的时间 单位毫秒
mLoopRotarySwitchView3
.setR(width/3)//设置R的大小
.setR(width/5)//设置R的大小
.setAutoRotation(true)//是否自动切换
.setAutoScrollDirection(LoopRotarySwitchView.AutoScrollDirection.left)//切换方向
.setAutoRotationTime(2000);//自动切换的时间 单位毫秒
Expand Down
130 changes: 82 additions & 48 deletions app/src/main/res/layout/activity_main.xml
Expand Up @@ -3,70 +3,104 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:weightSum="4"
android:fitsSystemWindows="true"
tools:context=".MainActivity">

<com.dalong.library.view.LoopRotarySwitchView
android:id="@+id/mLoopRotarySwitchView"
android:layout_width="fill_parent"
android:gravity="center_vertical"
android:gravity="center"
android:layout_weight="1"
android:layout_height="0dp"/>
<com.dalong.library.view.LoopRotarySwitchView
android:id="@+id/mLoopRotarySwitchView2"
android:layout_width="fill_parent"
android:gravity="center_vertical"
android:gravity="center"
android:layout_weight="1"
android:layout_height="0dp">
<ImageView
android:src="@mipmap/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.dalong.library.view.LoopRotarySwitchView>

<com.dalong.library.view.LoopRotarySwitchView
android:id="@+id/mLoopRotarySwitchView3"
android:layout_width="fill_parent"
android:gravity="center_vertical"
android:layout_weight="1"
android:layout_height="0dp">

<TextView
android:id="@+id/loopView0_tv1"
<ImageView
android:src="@mipmap/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/colorAccent"
android:textSize="45sp"
android:text=""/>
<TextView
android:id="@+id/loopView1_tv1"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:textSize="45sp"
android:gravity="center"
android:text="" />
<TextView
android:id="@+id/loopView2_tv1"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/point4"
android:textSize="45sp"
android:gravity="center"
android:text="" />
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.dalong.library.view.LoopRotarySwitchView>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="2"
android:layout_height="0dp">
<com.dalong.library.view.LoopRotarySwitchView
android:id="@+id/mLoopRotarySwitchView3"
android:layout_width="0dp"
android:gravity="center"
android:layout_weight="1"
app:orientation="vertical"
android:layout_height="match_parent">

<TextView
android:id="@+id/loopView0_tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/colorAccent"
android:textSize="45sp"
android:text=""/>
<TextView
android:id="@+id/loopView1_tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:textSize="45sp"
android:gravity="center"
android:text="" />
<TextView
android:id="@+id/loopView2_tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/point4"
android:textSize="45sp"
android:gravity="center"
android:text="" />
</com.dalong.library.view.LoopRotarySwitchView>

<com.dalong.library.view.LoopRotarySwitchView
android:id="@+id/mLoopRotarySwitchView4"
android:layout_width="0dp"
android:gravity="center"
android:layout_weight="1"
app:orientation="vertical"
app:autoRotation="true"
android:layout_height="match_parent">
<ImageView
android:src="@mipmap/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/image4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.dalong.library.view.LoopRotarySwitchView>
</LinearLayout>

</LinearLayout>

0 comments on commit a8896b2

Please sign in to comment.