Skip to content

Commit

Permalink
Merge pull request #51 from guyijie1211/theme
Browse files Browse the repository at this point in the history
0.2.9
  • Loading branch information
guyijie1211 authored Feb 18, 2023
2 parents efedcc9 + 12f9c4d commit 8475a26
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 214 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.yj1211.justlive"
minSdk 21
targetSdk 30
versionCode 19
versionName "0.2.8"
versionCode 20
versionName "0.2.9"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"versionCode": 20,
"versionName": "0.2.9",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ object Repository {
}
emit(result)
}
fun search(platform: String, keyWords: String, isLive: String) = liveData(Dispatchers.IO){
fun search(platform: String, keyWords: String, uid: String) = liveData(Dispatchers.IO){
val result = try {
val liveResponse = LiveNetwork.Search(platform, keyWords, isLive)
val liveResponse = LiveNetwork.Search(platform, keyWords, uid)
when (liveResponse.code) {
"200" -> {
val rooms = liveResponse.data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object LiveNetwork {
suspend fun getRealUrl(platform: String, roomId: String) = liveService.getRealUrl(platform, roomId).await()
suspend fun getRoomInfo(uid: String, platform: String, roomId: String) = liveService.getRoomInfo(uid, platform, roomId).await()
suspend fun getRoomsOn(uid: String) = liveService.getRoomsOn(uid).await()
suspend fun Search(platform: String, keyWords: String, isLive: String) = liveService.search(platform, keyWords, isLive).await()
suspend fun Search(platform: String, keyWords: String, uid: String) = liveService.search(platform, keyWords, uid).await()
suspend fun getAllAreas() = liveService.getAllAreas().await()
suspend fun login(username: String, password: String) = liveService.login(username, password).await()
suspend fun register(username: String, nickname: String, password: String) = liveService.register(username, nickname, password).await()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface LiveService {
@GET("/api/live/getRoomsOn")
fun getRoomsOn(@Query("uid") uid: String): Call<LiveRoomResponse>
@GET("/api/live/search")
fun search(@Query("platform") platform: String, @Query("keyWords") keyWords: String, @Query("isLive") isLive: String): Call<SearchResponse>
fun search(@Query("platform") platform: String, @Query("keyWords") keyWords: String, @Query("uid") uid: String): Call<SearchResponse>
@GET("/api/live/getAllAreas")
fun getAllAreas(): Call<AreaAllResponse>
@GET("/api/live/follow")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

object ServiceCreator {
private const val BASE_URL = "http://124.222.5.131:8013"
private const val BASE_URL = "http://yj1211.work:8013"

private val retrofit = Retrofit.Builder()
.baseUrl(BASE_URL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ class AboutActvity: AppCompatActivity(){
}
}
about_weibo.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW)
intent.addCategory(Intent.CATEGORY_DEFAULT)
intent.addCategory(Intent.CATEGORY_BROWSABLE)
intent.data = Uri.parse("sinaweibo://userinfo?uid=5211151565")
var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://weibo.com/u/5211151565"))
startActivity(intent)
}
about_qq.setOnClickListener {
Expand All @@ -81,21 +78,5 @@ class AboutActvity: AppCompatActivity(){
about_back.setOnClickListener {
this.onBackPressed()
}
about_bug.setOnClickListener {
var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.wolai.com/f/PjHjXcBVzyMs237mDLbrh"))
this.startActivity(intent)
}
about_new.setOnClickListener {
var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.wolai.com/f/eR8bqaBKPQeCDzyJWhBTNC"))
this.startActivity(intent)
}
about_progress.setOnClickListener {
var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.wolai.com/fpajKKnFwFiiai92UHd1Kk"))
this.startActivity(intent)
}
about_forum.setOnClickListener {
var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.9rai.com"))
this.startActivity(intent)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class HomeFragment : Fragment() {
1 -> RecommendFragment("douyu")
2 -> RecommendFragment("huya")
3 -> RecommendFragment("bilibili")
4 -> RecommendFragment("egame")
5 -> RecommendFragment("cc")
// 4 -> RecommendFragment("egame")
4 -> RecommendFragment("cc")
else -> Fragment()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class SearchActivity : AppCompatActivity(), View.OnClickListener {
}
})
intent.getStringExtra("query")?.also { query ->
viewModel.search("all", query, "0")
SunnyWeatherApplication.userInfo?.uid?.let { viewModel.search("all", query, it) }
}

}
Expand Down Expand Up @@ -160,7 +160,7 @@ class SearchActivity : AppCompatActivity(), View.OnClickListener {
isClearInputButtonEnabled = true
setSuggestionsDisabled(false)
setQueryInputGravity(Gravity.START or Gravity.CENTER)
setQueryInputHint("斗鱼用房间号搜")
setQueryInputHint("搜索功能需登录")
}
//选择历史记录或删除
private val mOnSuggestionChangeListener = object : OnSuggestionChangeListener {
Expand Down Expand Up @@ -230,7 +230,7 @@ class SearchActivity : AppCompatActivity(), View.OnClickListener {
viewModel.clearList()
persistentSearchView.hideProgressBar(false)
persistentSearchView.showLeftButton()
viewModel.search("all", query, "0")
SunnyWeatherApplication.userInfo?.uid?.let { viewModel.search("all", query, it) }
}

//保存历史记录
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import com.sunnyweather.android.logic.Repository
import com.sunnyweather.android.logic.model.Owner

class SearchViewModel : ViewModel(){
class SearchRequest (val platform: String, val keyWords: String, val isLive: String)
class SearchRequest (val platform: String, val keyWords: String, val uid: String)

private val searchWordLiveData = MutableLiveData<SearchRequest>()
var ownersList = ArrayList<Owner>()
val ownerListLiveData = Transformations.switchMap(searchWordLiveData) {
value -> Repository.search(value.platform, value.keyWords, value.isLive)
value -> Repository.search(value.platform, value.keyWords, value.uid)
}

fun search(platform: String, keyWords: String, isLive: String) {
Expand Down
157 changes: 4 additions & 153 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,120 +63,9 @@
android:layout_marginTop="5dp"
android:text="意见反馈"
android:textColor="?attr/colorOnPrimary" />
<androidx.cardview.widget.CardView
android:id="@+id/about_report_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_report"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="5dp"
app:cardBackgroundColor="?attr/colorPrimary"
app:cardCornerRadius="20dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:divider="?attr/colorPrimaryVariant"
android:orientation="vertical"
android:paddingHorizontal="30dp"
android:showDividers="middle">

<RelativeLayout
android:id="@+id/about_bug"
android:layout_width="match_parent"
android:layout_height="50dp">

<ImageView
android:id="@+id/about_logo_bug"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:src="@drawable/logo_wolai" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/about_logo_bug"
android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/about_logo_bug"
android:text="BUG反馈"
android:textColor="?attr/colorOnPrimary"
android:textSize="15dp" />

<ImageView
android:id="@+id/about_arrow_bug"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_baseline_chevron_right_24" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/about_new"
android:layout_width="match_parent"
android:layout_height="50dp">

<ImageView
android:id="@+id/about_logo_new"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:src="@drawable/logo_wolai" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/about_logo_new"
android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/about_logo_new"
android:text="功能建议"
android:textColor="?attr/colorOnPrimary"
android:textSize="15dp" />

<ImageView
android:id="@+id/about_arrow_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_baseline_chevron_right_24" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/about_progress"
android:layout_width="match_parent"
android:layout_height="50dp">

<ImageView
android:id="@+id/about_logo_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:src="@drawable/logo_wolai" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/about_logo_progress"
android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/about_logo_progress"
android:text="开发进度"
android:textColor="?attr/colorOnPrimary"
android:textSize="15dp" />

<ImageView
android:id="@+id/about_arrow_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_baseline_chevron_right_24" />
</RelativeLayout>

</LinearLayout>
</androidx.cardview.widget.CardView>

<TextView
android:layout_below="@+id/about_report_card"
android:layout_below="@+id/about_about"
android:id="@+id/about_platform"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -221,7 +110,7 @@
android:layout_alignTop="@+id/about_logo_web"
android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/about_logo_web"
android:text="网页端(PC用)"
android:text="网页端"
android:textColor="?attr/colorOnPrimary"
android:textSize="15dp" />

Expand Down Expand Up @@ -268,7 +157,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_height="200dp"
android:divider="?attr/colorPrimaryVariant"
android:orientation="vertical"
android:paddingHorizontal="30dp"
Expand Down Expand Up @@ -338,7 +227,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/about_arrow_weibo"
android:text="\@YJ顾"
android:text="\@YJ1211_"
android:textColor="?attr/colorOnPrimary" />

<ImageView
Expand Down Expand Up @@ -425,44 +314,6 @@
android:layout_centerVertical="true"
android:src="@drawable/ic_baseline_chevron_right_24" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/about_forum"
android:layout_width="match_parent"
android:layout_height="50dp">

<ImageView
android:id="@+id/about_logo_forum"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:src="@drawable/logo_forums" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/about_logo_forum"
android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/about_logo_forum"
android:text="论坛"
android:textColor="?attr/colorOnPrimary"
android:textSize="15dp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/about_arrow_forum"
android:text="由\@小优 提供"
android:textColor="?attr/colorOnPrimary" />

<ImageView
android:id="@+id/about_arrow_forum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_baseline_chevron_right_24" />
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

Expand Down
Loading

0 comments on commit 8475a26

Please sign in to comment.