add back in log output temporarily in sidebar

This commit is contained in:
Nathan Freitas 2015-02-04 12:36:24 -05:00
parent 8dc2748520
commit 5cb6cb930d
2 changed files with 26 additions and 48 deletions

View File

@ -182,48 +182,17 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="240dp"
android:layout_width="320dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/left_drawer"
android:layout_gravity="start"
android:background="@color/panel_background"
android:layout_gravity="start"
android:background="#333333"
>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
<!--
<SlidingDrawer
android:layout_width="fill_parent"
android:id="@+id/SlidingDrawer"
android:handle="@+id/slideButton"
android:content="@+id/trafficLog"
android:padding="10dip"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="bottom"
>
<Button
android:id="@+id/slideButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/menu_log" ></Button>
<RelativeLayout android:id="@+id/trafficLog"
android:gravity="top"
android:layout_width="fill_parent"
android:visibility="invisible"
android:layout_height="wrap_content"
android:padding="6dp"
android:layout_marginTop="6dp"
android:background="#ee333333">
<TextView
<TextView
android:id="@+id/orbotLog"
android:textColor="#FFFFFF"
android:textColor="#00FF00"
android:background="#333333"
android:textSize="12sp"
android:gravity="left"
android:layout_width="fill_parent"
@ -231,12 +200,12 @@
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp"
android:textIsSelectable="true"
android:fontFamily="sans-serif-light"
android:fontFamily="monospace"
/>
</RelativeLayout>
</SlidingDrawer>
</FrameLayout>
-->
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
</LinearLayout>

View File

@ -70,6 +70,8 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
private TextView downloadText = null;
private TextView uploadText = null;
private TextView mTxtOrbotLog = null;
private Button mBtnBrowser = null;
private Button mBtnVPN = null;
@ -211,6 +213,8 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
setupMenu();
mTxtOrbotLog = (TextView)findViewById(R.id.orbotLog);
lblStatus = (TextView)findViewById(R.id.lblStatus);
lblStatus.setOnLongClickListener(this);
imgStatus = (ImageProgressView)findViewById(R.id.imgStatus);
@ -889,10 +893,13 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
if (mItemOnOff != null)
mItemOnOff.setTitle(R.string.menu_stop);
if (lblStatus != null && torServiceMsg != null)
if (torServiceMsg.indexOf('%')!=-1)
lblStatus.setText(torServiceMsg);
if (torServiceMsg != null && torServiceMsg.length() > 0)
{
// appendLogTextAndScroll(torServiceMsg);
mTxtOrbotLog.append(torServiceMsg + '\n');
}
boolean showFirstTime = mPrefs.getBoolean("connect_first_time",true);
@ -930,9 +937,11 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
if (torServiceMsg.indexOf('%')!=-1)
lblStatus.setText(torServiceMsg);
//appendLogTextAndScroll(torServiceMsg);
if (torServiceMsg != null && torServiceMsg.length() > 0)
{
mTxtOrbotLog.append(torServiceMsg + '\n');
}
}
else if (torStatus == TorServiceConstants.STATUS_OFF)
{
@ -960,7 +969,7 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
startService (TorServiceConstants.CMD_START);
torStatus = TorServiceConstants.STATUS_CONNECTING;
// mTxtOrbotLog.setText("");
mTxtOrbotLog.setText("");
//here we update the UI which is a bit sloppy and mixed up code wise
//might be best to just call updateStatus() instead of directly manipulating UI in this method - yep makes sense