Skip to content

Commit

Permalink
feat: 修正头像显示
Browse files Browse the repository at this point in the history
  • Loading branch information
liewstar committed Dec 8, 2024
1 parent f360533 commit 2272f08
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/CQUPT/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected void onCreate(Bundle savedInstanceState) {
NavigationView navigationView = binding.navView;
View headerView = navigationView.getHeaderView(0);
TextView everyDay = headerView.findViewById(R.id.header_everyday);
everyDay.setText("这是每日一言");
//everyDay.setText("这是每日一言");

// 配置导航
mAppBarConfiguration = new AppBarConfiguration.Builder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,11 @@ private void startCourseSelection() {

executor = Executors.newSingleThreadScheduledExecutor();
executor.scheduleWithFixedDelay(() -> {
// Simulate course selection attempt
for (String course : courses) {
// Random success simulation (20% chance)
if (new Random().nextInt(100) < 20) {
mainHandler.post(() -> {
adapter.addSuccessCourse(course.trim());
binding.statusText.setText("成功抢到: " + course.trim());
});
}
mainHandler.post(() -> {
adapter.addSuccessCourse(course.trim());
binding.statusText.setText("成功抢到: " + course.trim());
});
}
}, 0, delay * 10L, TimeUnit.MILLISECONDS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
android:id="@+id/profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/baseline_account_circle_24"
android:src="@drawable/logo"
app:civ_border_width="2dp"
app:civ_border_color="#FFFFFF"
app:layout_constraintBottom_toTopOf="@id/login_card"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/nav_header_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@
android:padding="4dp"
android:background="@android:color/white"
app:shapeAppearanceOverlay="@style/CircleImageView"
android:src="@drawable/emoji_happy"
android:src="@drawable/logo"
android:contentDescription="@string/nav_header_desc" />

<TextView
android:id="@+id/header_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/nav_header_vertical_spacing"
android:text="姓名"
android:text="邮兵工具箱"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="@android:color/white"
android:textStyle="bold" />

<TextView
android:id="@+id/header_everyday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:text="每日一句励志"
android:text="Talk is cheap, show me your code."
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
android:textColor="@android:color/white" />

Expand Down

0 comments on commit 2272f08

Please sign in to comment.