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> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="240dp" android:layout_width="320dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:id="@+id/left_drawer" android:id="@+id/left_drawer"
android:layout_gravity="start" android:layout_gravity="start"
android:background="@color/panel_background" 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:id="@+id/orbotLog"
android:textColor="#FFFFFF" android:textColor="#00FF00"
android:background="#333333"
android:textSize="12sp" android:textSize="12sp"
android:gravity="left" android:gravity="left"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -231,12 +200,12 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:textIsSelectable="true" android:textIsSelectable="true"
android:fontFamily="sans-serif-light" android:fontFamily="monospace"
/> />
</RelativeLayout> </LinearLayout>
</SlidingDrawer>
</FrameLayout> </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 downloadText = null;
private TextView uploadText = null; private TextView uploadText = null;
private TextView mTxtOrbotLog = null;
private Button mBtnBrowser = null; private Button mBtnBrowser = null;
private Button mBtnVPN = null; private Button mBtnVPN = null;
@ -211,6 +213,8 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
setupMenu(); setupMenu();
mTxtOrbotLog = (TextView)findViewById(R.id.orbotLog);
lblStatus = (TextView)findViewById(R.id.lblStatus); lblStatus = (TextView)findViewById(R.id.lblStatus);
lblStatus.setOnLongClickListener(this); lblStatus.setOnLongClickListener(this);
imgStatus = (ImageProgressView)findViewById(R.id.imgStatus); imgStatus = (ImageProgressView)findViewById(R.id.imgStatus);
@ -889,10 +893,13 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
if (mItemOnOff != null) if (mItemOnOff != null)
mItemOnOff.setTitle(R.string.menu_stop); mItemOnOff.setTitle(R.string.menu_stop);
if (lblStatus != null && torServiceMsg != null)
if (torServiceMsg.indexOf('%')!=-1)
lblStatus.setText(torServiceMsg);
if (torServiceMsg != null && torServiceMsg.length() > 0) if (torServiceMsg != null && torServiceMsg.length() > 0)
{ {
// appendLogTextAndScroll(torServiceMsg); mTxtOrbotLog.append(torServiceMsg + '\n');
} }
boolean showFirstTime = mPrefs.getBoolean("connect_first_time",true); boolean showFirstTime = mPrefs.getBoolean("connect_first_time",true);
@ -930,8 +937,10 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
if (torServiceMsg.indexOf('%')!=-1) if (torServiceMsg.indexOf('%')!=-1)
lblStatus.setText(torServiceMsg); lblStatus.setText(torServiceMsg);
//appendLogTextAndScroll(torServiceMsg); if (torServiceMsg != null && torServiceMsg.length() > 0)
{
mTxtOrbotLog.append(torServiceMsg + '\n');
}
} }
else if (torStatus == TorServiceConstants.STATUS_OFF) else if (torStatus == TorServiceConstants.STATUS_OFF)
@ -960,7 +969,7 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
startService (TorServiceConstants.CMD_START); startService (TorServiceConstants.CMD_START);
torStatus = TorServiceConstants.STATUS_CONNECTING; torStatus = TorServiceConstants.STATUS_CONNECTING;
// mTxtOrbotLog.setText(""); mTxtOrbotLog.setText("");
//here we update the UI which is a bit sloppy and mixed up code wise //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 //might be best to just call updateStatus() instead of directly manipulating UI in this method - yep makes sense