@Override public void onServiceDisconnected(ComponentName name) { try { mLoggerService.stopLogger(); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } mLoggerService = null; }
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { try { mOppacity = progress; if (mLoggerService != null) { mLoggerService.setOppacity(mOppacity); } } catch (RemoteException e) { e.printStackTrace(); } }
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { try { mHorizontalLogLinesOffset = progress; if (mLoggerService != null) { mLoggerService.setHorizontalLogLinesOffset(mHorizontalLogLinesOffset); } } catch (Exception e) { // TODO: handle exception } }
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { try { mHorizontalLogLinesWeight = progress; if (mLoggerService != null) { mLoggerService.setHorizontalLogLinesWeight(mHorizontalLogLinesWeight); } } catch (Exception e) { e.printStackTrace(); } }
private void stopLogger() { if (mLoggerService != null) { try { mLoggerService.stopLogger(); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } mLoggerServiceConnection.onServiceDisconnected(null); unbindService(mLoggerServiceConnection); } }
@Override public void afterTextChanged(Editable s) { synchronized (mLockObect) { mGrepText = s.toString(); try { if (mLoggerService != null) { mLoggerService.setGrepText(mGrepText); } } catch (RemoteException e) { e.printStackTrace(); } } }
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { synchronized (mLockObect) { mGrepEnable = isChecked; try { if (mLoggerService != null) { mLoggerService.enableGrep(mGrepEnable); } } catch (RemoteException e) { e.printStackTrace(); } } }
@Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { Spinner spinner = (Spinner) arg0; mSelectedFontColorPosition = spinner.getSelectedItemPosition(); try { TypedArray ta = getResources().obtainTypedArray(R.array.fontcolor_value); mFontColor = ta.getColor(mSelectedFontColorPosition, 0); if (mLoggerService != null) { mLoggerService.setFontColor(mFontColor); } } catch (RemoteException e) { e.printStackTrace(); } }
@Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { Spinner spinenr = (Spinner) arg0; String fontsizeStr = (String) spinenr.getSelectedItem(); mSelectedFontSizePosition = arg2; try { mFontSize = Integer.valueOf(fontsizeStr); if (mLoggerService != null) { mLoggerService.setFontsize(mFontSize); } } catch (RemoteException e) { e.printStackTrace(); } }
@Override public void onCheckedChanged(CompoundButton checBox, boolean isChecked) { int checkboxIndex = (Integer) checBox.getTag(); int logcatPartMaskOffset = LOGCAT_COLUMN_POS[checkboxIndex]; int logcatPartMask = 1 << logcatPartMaskOffset; int checkboxStateMask = 1 << checkboxIndex; if (isChecked) { mDisplayContents |= logcatPartMask; mDisplayContentsCheckBoxState |= checkboxStateMask; } else { mDisplayContents &= ~logcatPartMask; mDisplayContentsCheckBoxState &= checkboxStateMask; } try { if (mLoggerService != null) { mLoggerService.setSelectedContents(mDisplayContents); } } catch (RemoteException e) { e.printStackTrace(); } }
private void startLogger() { if (mLoggerService == null) { bindService( new Intent(getApplicationContext(), LoggerService.class), mLoggerServiceConnection, Context.BIND_AUTO_CREATE); } if (mLoggerService != null) { try { mLoggerService.setOppacity(mOppacity); mLoggerService.setVerticalLogLinesWeight(mVerticalLogLinesWeight); mLoggerService.setVerticalLogLinesOffset(mVerticalLogLinesOffset); mLoggerService.setHorizontalLogLinesWeight(mHorizontalLogLinesWeight); mLoggerService.setHorizontalLogLinesOffset(mHorizontalLogLinesOffset); mLoggerService.startLogger(); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
@Override public void onServiceConnected(ComponentName name, IBinder service) { mLoggerService = ILoggerService.Stub.asInterface(service); try { mLoggerService.setOppacity(mOppacity); mLoggerService.setVerticalLogLinesWeight(mVerticalLogLinesWeight); mLoggerService.setVerticalLogLinesOffset(mVerticalLogLinesOffset); mLoggerService.setHorizontalLogLinesWeight(mHorizontalLogLinesWeight); mLoggerService.setHorizontalLogLinesOffset(mHorizontalLogLinesOffset); mLoggerService.setFontsize(mFontSize); mLoggerService.setFontColor(mFontColor); mLoggerService.enableGrep(mGrepEnable); mLoggerService.setGrepText(mGrepText); mLoggerService.setSelectedContents(mDisplayContents); mLoggerService.startLogger(); } catch (RemoteException e) { e.printStackTrace(); } }