dev
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.extensions;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -87,13 +88,18 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
|
||||
@Override
|
||||
public void renderWeatherInfo( String temp, String desc, int iconId ) {
|
||||
boolean hidden = false;
|
||||
if ( iconId != 0 ) {
|
||||
mWeatherIcon.setImageResource( iconId );
|
||||
mWeatherIcon.setVisibility( View.VISIBLE );
|
||||
} else {
|
||||
mWeatherIcon.setVisibility( View.GONE );
|
||||
hidden |= true;
|
||||
}
|
||||
hidden |= TextUtils.isEmpty( temp );
|
||||
hidden |= TextUtils.isEmpty( desc );
|
||||
mWeatherTemp.setText( temp );
|
||||
mWeatherDesc.setText( desc );
|
||||
mWeatherContainer.setVisibility( hidden ? View.GONE : View.VISIBLE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
|
||||
int day = calendar.get( Calendar.DAY_OF_MONTH );
|
||||
int week = calendar.get( Calendar.DAY_OF_WEEK );
|
||||
|
||||
String timeStr = getContext().getResources().getString( R.string.module_ext_str_time_format, hour, minute );
|
||||
String timeStr = getContext().getResources().getString( R.string.module_ext_str_time_format, hour, minute > 9 ? String.valueOf( minute ) : "0" + minute );
|
||||
String dateStr = getContext().getResources().getString( R.string.module_ext_str_date_format, month + 1, day, mWeeks[week - 1] );
|
||||
mView.renderTime( dateStr, timeStr );
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="13dp"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_date"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -117,6 +118,7 @@
|
||||
android:background="@drawable/module_ext_drawable_msg_bkg"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:visibility="invisible"
|
||||
android:textSize="10dp"
|
||||
tools:text="···" />
|
||||
</FrameLayout>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<string name="app_name">mogo-module-extensions</string>
|
||||
<string name="module_ext_str_voice_msg">你好,蘑菇2.0开启智慧互联新世界</string>
|
||||
<string name="module_ext_str_date_format">%1$d月%2$d日 %3$s</string>
|
||||
<string name="module_ext_str_time_format">%1$d:%2$d</string>
|
||||
<string name="module_ext_str_time_format">%1$d:%2$s</string>
|
||||
<string name="module_ext_str_weather_temp_format">%s° </string>
|
||||
<string-array name="module_ext_str_arr_week">
|
||||
<item>周日</item>
|
||||
|
||||
Reference in New Issue
Block a user