New network status icons
@@ -22,6 +22,7 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -61,6 +62,7 @@ public class EmailListActivity extends ActionBarActivity implements
|
||||
private FolderListAdapter mFolderAdapter;
|
||||
private ListView mFolderList;
|
||||
private int mCurPos;
|
||||
private ImageView mNetworkStatusIcon;
|
||||
private TextView mNetworkStatusText;
|
||||
private ActionBarDrawerToggle mDrawerToggle;
|
||||
|
||||
@@ -93,6 +95,7 @@ public class EmailListActivity extends ActionBarActivity implements
|
||||
mDrawerOuter = (RelativeLayout) findViewById(R.id.drawer_outer);
|
||||
mFolderAdapter = new FolderListAdapter(this);
|
||||
mFolderList = (ListView) findViewById(R.id.drawer);
|
||||
mNetworkStatusIcon = (ImageView) findViewById(R.id.network_status_icon);
|
||||
mNetworkStatusText = (TextView) findViewById(R.id.network_status_text);
|
||||
|
||||
// Set the list of folders
|
||||
@@ -418,31 +421,35 @@ public class EmailListActivity extends ActionBarActivity implements
|
||||
switch (I2PBote.getInstance().getNetworkStatus()) {
|
||||
case DELAY:
|
||||
statusText = R.string.connect_delay;
|
||||
statusIcon = getResources().getDrawable(android.R.drawable.presence_away);
|
||||
statusIcon = getResources().getDrawable(R.drawable.ic_av_timer_grey600_24dp);
|
||||
break;
|
||||
case CONNECTING:
|
||||
statusText = R.string.connecting;
|
||||
statusIcon = getResources().getDrawable(android.R.drawable.presence_away);
|
||||
statusIcon = getResources().getDrawable(R.drawable.ic_cloud_queue_grey600_24dp);
|
||||
break;
|
||||
case CONNECTED:
|
||||
statusText = R.string.connected;
|
||||
statusIcon = getResources().getDrawable(android.R.drawable.presence_online);
|
||||
statusIcon = getResources().getDrawable(R.drawable.ic_cloud_done_grey600_24dp);
|
||||
break;
|
||||
case ERROR:
|
||||
statusText = R.string.error;
|
||||
statusIcon = getResources().getDrawable(android.R.drawable.presence_busy);
|
||||
statusIcon = getResources().getDrawable(R.drawable.ic_error_red_24dp);
|
||||
break;
|
||||
case NOT_STARTED:
|
||||
default:
|
||||
statusText = R.string.not_started;
|
||||
statusIcon = getResources().getDrawable(android.R.drawable.presence_offline);
|
||||
statusIcon = getResources().getDrawable(R.drawable.ic_cloud_off_grey600_24dp);
|
||||
}
|
||||
mNetworkStatusText.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNetworkStatusText.setText(statusText);
|
||||
mNetworkStatusText.setCompoundDrawablesWithIntrinsicBounds(
|
||||
statusIcon, null, null, null);
|
||||
}
|
||||
});
|
||||
mNetworkStatusIcon.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNetworkStatusIcon.setImageDrawable(statusIcon);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/ic_av_timer_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 643 B |
BIN
app/src/main/res/drawable-hdpi/ic_cloud_done_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 486 B |
BIN
app/src/main/res/drawable-hdpi/ic_cloud_off_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 599 B |
BIN
app/src/main/res/drawable-hdpi/ic_error_red_24dp.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
app/src/main/res/drawable-mdpi/ic_av_timer_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 424 B |
BIN
app/src/main/res/drawable-mdpi/ic_cloud_done_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 371 B |
BIN
app/src/main/res/drawable-mdpi/ic_cloud_off_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 435 B |
BIN
app/src/main/res/drawable-mdpi/ic_error_red_24dp.png
Normal file
|
After Width: | Height: | Size: 421 B |
BIN
app/src/main/res/drawable-xhdpi/ic_av_timer_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
app/src/main/res/drawable-xhdpi/ic_cloud_done_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 584 B |
BIN
app/src/main/res/drawable-xhdpi/ic_cloud_off_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 732 B |
BIN
app/src/main/res/drawable-xhdpi/ic_error_red_24dp.png
Normal file
|
After Width: | Height: | Size: 737 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_av_timer_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_cloud_done_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 823 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_cloud_off_grey600_24dp.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_error_red_24dp.png
Normal file
|
After Width: | Height: | Size: 974 B |
@@ -80,27 +80,35 @@
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/network_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/folder_activated_background">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_status_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/nav_entry_height"
|
||||
android:drawableLeft="@android:drawable/presence_offline"
|
||||
android:drawablePadding="10dp"
|
||||
android:drawableStart="@android:drawable/presence_offline"
|
||||
android:gravity="center_vertical"
|
||||
<ImageView
|
||||
android:id="@+id/network_status_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingEnd="@dimen/nav_horizontal_margin"
|
||||
android:paddingLeft="@dimen/nav_horizontal_margin"
|
||||
android:paddingRight="@dimen/nav_horizontal_margin"
|
||||
android:paddingStart="@dimen/nav_horizontal_margin"
|
||||
android:src="@drawable/ic_cloud_off_grey600_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_status_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/nav_entry_height"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingEnd="@dimen/nav_horizontal_margin"
|
||||
android:paddingLeft="@dimen/listitem_text_left_margin"
|
||||
android:paddingRight="@dimen/nav_horizontal_margin"
|
||||
android:paddingStart="@dimen/listitem_text_left_margin"
|
||||
android:text="@string/network_status"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||