Skip to content

Commit

Permalink
'jCenter迁移到jitpack'
Browse files Browse the repository at this point in the history
  • Loading branch information
oooo7777777 committed Apr 12, 2021
1 parent 4d36348 commit 4fb9205
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 41 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# VLibrary40

[[]https://jitpack.io/v/oooo7777777/VLibrary.svg)]https://jitpack.io/#oooo7777777/VLibrary)


#### 介绍

- 基于MVVM模式组件化集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle组件
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 280
versionName "2.8.0"
versionCode 290
versionName "2.9.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
145 changes: 112 additions & 33 deletions app/src/main/res/layout/activity_network.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,132 @@
type="com.v.demo.NetworkActivity" />
</data>

<LinearLayout

<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">

<Button
android:id="@+id/bt0"
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="自定义网络请求(返回去壳数据)"
android:textAllCaps="false"
app:click="@{v}" />
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="170dp"
app:contentScrim="@android:color/holo_blue_bright"
app:expandedTitleMarginBottom="100dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="我是collapsebar的标题">

<Button
android:id="@+id/bt1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="自定义网络请求(返回未去壳数据)"
android:textAllCaps="false"
app:click="@{v}" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第一个固定(pin)"
android:textSize="40sp"
app:layout_collapseMode="pin" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="不设置,跟随滑动"
android:textSize="40sp" />

<Button
android:id="@+id/bt2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="VLibrary库网络请求"
android:textAllCaps="false"
app:click="@{v}" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="视察效果(parallax)"
android:textSize="40sp"
app:layout_collapseMode="parallax" />

<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_gravity="top"
android:background="#600f"
app:layout_collapseMode="pin">

<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我是toolbar" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>

<TextView
android:id="@+id/tvContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="appbar之内,collap之外"
android:textColor="#0f0" />
</com.google.android.material.appbar.AppBarLayout>

<androidx.core.widget.NestedScrollView
android:id="@+id/n_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="@android:color/black"
tools:text="请求数据" />
android:orientation="vertical">


<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<Button
android:id="@+id/bt0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="自定义网络请求(返回去壳数据)"
android:textAllCaps="false"
app:click="@{v}" />


<Button
android:id="@+id/bt1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="自定义网络请求(返回未去壳数据)"
android:textAllCaps="false"
app:click="@{v}" />


<Button
android:id="@+id/bt2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="VLibrary库网络请求"
android:textAllCaps="false"
app:click="@{v}" />


<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">

<TextView
android:id="@+id/tvContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="@android:color/black"
tools:text="请求数据" />

</ScrollView>
</LinearLayout>


</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

</ScrollView>
</LinearLayout>

</layout>
7 changes: 4 additions & 3 deletions vlibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ plugins {
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-android-extensions'
id 'com.github.dcendents.android-maven'
}

group='com.github.oooo7777777'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 260
versionName "2.6.0"
versionCode 290
versionName "2.9.0"
}

compileOptions {
Expand Down
4 changes: 2 additions & 2 deletions vlibrary/src/main/java/com/v/base/utils/FragmentUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private fun FragmentManager.inTransaction(func: FragmentTransaction.() -> Fragme
* @param bundle 传值
*/
fun Context.addFragment(fragment: Fragment, frameId: Int, bundle: Bundle? = null) = run {
if (bundle == null) {
if (bundle != null) {
fragment.arguments = bundle
}
if (this is AppCompatActivity) {
Expand All @@ -42,7 +42,7 @@ fun Context.addFragment(fragment: Fragment, frameId: Int, bundle: Bundle? = null
*/
fun Context.replaceFragment(fragment: Fragment, frameId: Int, bundle: Bundle? = null) =
run {
if (bundle == null) {
if (bundle != null) {
fragment.arguments = bundle
}
if (this is AppCompatActivity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fun View.click(onClickListener: View.OnClickListener?, clickTime: Long) {
*/
@BindingAdapter(value = ["textBold"], requireAll = false)
fun TextView.textBold(boolean: Boolean) {
this.paint.isFakeBoldText = true
this.paint.isFakeBoldText = boolean
}


Expand Down

0 comments on commit 4fb9205

Please sign in to comment.