|
@@ -9,7 +9,6 @@ import android.graphics.drawable.Drawable;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.ImageView;
|
|
|
-import android.widget.LinearLayout;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
@@ -419,12 +418,12 @@ public class MainActivity extends BaseActivity {
|
|
|
*/
|
|
|
private void updateNetworkTypeView() {
|
|
|
if (NetWorkUtils.getNetworkType() != -1){
|
|
|
- LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) iv_networkType.getLayoutParams();
|
|
|
+ ViewGroup.LayoutParams layoutParams = iv_networkType.getLayoutParams();
|
|
|
layoutParams.width = (int) getResources().getDimension(R.dimen.dp_32);
|
|
|
layoutParams.height = (int) getResources().getDimension(R.dimen.dp_32);
|
|
|
iv_networkType.setImageResource(NetWorkUtils.getNetworkType());
|
|
|
} else {//无网络
|
|
|
- LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) iv_networkType.getLayoutParams();
|
|
|
+ ViewGroup.LayoutParams layoutParams = iv_networkType.getLayoutParams();
|
|
|
layoutParams.width = (int) getResources().getDimension(R.dimen.dp_72);
|
|
|
layoutParams.height = (int) getResources().getDimension(R.dimen.dp_32);
|
|
|
iv_networkType.setImageResource(R.mipmap.network_icon_no);
|