功能添加资料的上传

This commit is contained in:
wei 2016-12-02 20:11:40 +08:00
parent 1358b1add8
commit 0d8e1c7594
30 changed files with 3547 additions and 0 deletions

View File

@ -0,0 +1,105 @@
package net.oschina.app.LockPattern;
import java.util.List;
import net.oschina.app.AppStart;
import net.oschina.app.R;
import net.oschina.app.LockPattern.LockPatternView.Cell;
import net.oschina.app.LockPattern.LockPatternView.DisplayMode;
import net.oschina.app.ui.MainActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.content.SharedPreferences;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.widget.Toast;
public class LockActivity extends Activity implements
LockPatternView.OnPatternListener {
private static final String TAG = "LockActivity";
private List<Cell> lockPattern;
private LockPatternView lockPatternView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences preferences = getSharedPreferences(LockPatternMainActivity.LOCK,
MODE_PRIVATE);
String patternString = preferences.getString(LockPatternMainActivity.LOCK_KEY,
null);
if (patternString == null) {
finish();
return;
}
lockPattern = LockPatternView.stringToPattern(patternString);
setContentView(R.layout.activity_lock);
lockPatternView = (LockPatternView) findViewById(R.id.lock_pattern);
lockPatternView.setOnPatternListener(this);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// disable back key
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
return super.onKeyDown(keyCode, event);
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// // Inflate the menu; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
@Override
public void onPatternStart() {
Log.d(TAG, "onPatternStart");
}
@Override
public void onPatternCleared() {
Log.d(TAG, "onPatternCleared");
}
@Override
public void onPatternCellAdded(List<Cell> pattern) {
Log.d(TAG, "onPatternCellAdded");
Log.e(TAG, LockPatternView.patternToString(pattern));
// Toast.makeText(this, LockPatternView.patternToString(pattern),
// Toast.LENGTH_LONG).show();
}
@Override
public void onPatternDetected(List<Cell> pattern) {
Log.d(TAG, "onPatternDetected");
if (pattern.equals(lockPattern)) {
if(AppStart.from_top == 1) {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
finish();
} else {
lockPatternView.setDisplayMode(DisplayMode.Wrong);
Toast.makeText(this, R.string.lockpattern_error, Toast.LENGTH_LONG)
.show();
}
}
}

View File

@ -0,0 +1,70 @@
package net.oschina.app.LockPattern;
/**
* Created by panyang on 2016/11/25.
*/
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
import net.oschina.app.R;
import net.oschina.app.AppStart;
public class LockPatternMainActivity extends Activity implements OnClickListener {
private static final String TAG = "MainActivity";
public static final String LOCK = "lock";
public static final String LOCK_KEY = "lock_key";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lockpattern_main);
SharedPreferences preferences = getSharedPreferences(LOCK, MODE_PRIVATE);
String lockPattenString = preferences.getString(LOCK_KEY, null);
if (lockPattenString != null) {
AppStart.from_top = 0;
Intent intent = new Intent(this, LockActivity.class);
startActivity(intent);
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.lock:
Intent intent = new Intent(this, LockSetupActivity.class);
startActivity(intent);
break;
case R.id.unlock:
getSharedPreferences(LOCK, MODE_PRIVATE).edit().clear().commit();
Toast.makeText(this,
R.string.cancel_successful,
Toast.LENGTH_LONG).show();
break;
default:
break;
}
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,208 @@
package net.oschina.app.LockPattern;
/**
* Created by panyang on 2016/11/25.
*/
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import net.oschina.app.R;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
//to add
import net.oschina.app.LockPattern.LockPatternView.Cell;
import net.oschina.app.LockPattern.LockPatternView.DisplayMode;
public class LockSetupActivity extends Activity implements LockPatternView.OnPatternListener, OnClickListener {
private static final String TAG = "LockSetupActivity";
private LockPatternView lockPatternView;
private Button leftButton;
private Button rightButton;
private static final int STEP_1 = 1; // 开始
private static final int STEP_2 = 2; // 第一次设置手势完成
private static final int STEP_3 = 3; // 按下继续按钮
private static final int STEP_4 = 4; // 第二次设置手势完成
// private static final int SETP_5 = 4; // 按确认按钮
private int step;
private List<Cell> choosePattern;
private boolean confirm = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_locksetup);
lockPatternView = (LockPatternView) findViewById(R.id.lock_pattern);
lockPatternView.setOnPatternListener(this);
leftButton = (Button) findViewById(R.id.left_btn);
rightButton = (Button) findViewById(R.id.right_btn);
step = STEP_1;
updateView();
}
private void updateView() {
switch (step) {
case STEP_1:
leftButton.setText(R.string.cancel);
rightButton.setText("");
rightButton.setEnabled(false);
choosePattern = null;
confirm = false;
lockPatternView.clearPattern();
lockPatternView.enableInput();
break;
case STEP_2:
leftButton.setText(R.string.try_again);
rightButton.setText(R.string.goon);
rightButton.setEnabled(true);
lockPatternView.disableInput();
break;
case STEP_3:
leftButton.setText(R.string.cancel);
rightButton.setText("");
rightButton.setEnabled(false);
lockPatternView.clearPattern();
lockPatternView.enableInput();
break;
case STEP_4:
leftButton.setText(R.string.cancel);
if (confirm) {
rightButton.setText(R.string.confirm);
rightButton.setEnabled(true);
lockPatternView.disableInput();
} else {
rightButton.setText("");
lockPatternView.setDisplayMode(DisplayMode.Wrong);
lockPatternView.enableInput();
rightButton.setEnabled(false);
}
break;
default:
break;
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.left_btn:
if (step == STEP_1 || step == STEP_3 || step == STEP_4) {
finish();
} else if (step == STEP_2) {
step = STEP_1;
updateView();
}
break;
case R.id.right_btn:
if (step == STEP_2) {
step = STEP_3;
updateView();
} else if (step == STEP_4) {
SharedPreferences preferences = getSharedPreferences(
LockPatternMainActivity.LOCK, MODE_PRIVATE);
preferences
.edit()
.putString(LockPatternMainActivity.LOCK_KEY,
LockPatternView.patternToString(choosePattern))
.commit();
//Intent intent = new Intent(this, lockActivity.class);
//startActivity(intent);
finish();
}
break;
default:
break;
}
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
@Override
public void onPatternStart() {
Log.d(TAG, "onPatternStart");
}
@Override
public void onPatternCleared() {
Log.d(TAG, "onPatternCleared");
}
@Override
public void onPatternCellAdded(List<Cell> pattern) {
Log.d(TAG, "onPatternCellAdded");
}
@Override
public void onPatternDetected(List<Cell> pattern) {
Log.d(TAG, "onPatternDetected");
if (pattern.size() < LockPatternView.MIN_LOCK_PATTERN_SIZE) {
Toast.makeText(this,
R.string.lockpattern_recording_incorrect_too_short,
Toast.LENGTH_LONG).show();
lockPatternView.setDisplayMode(DisplayMode.Wrong);
return;
}
if (choosePattern == null) {
choosePattern = new ArrayList<Cell>(pattern);
// Log.d(TAG, "choosePattern = "+choosePattern.toString());
// Log.d(TAG, "choosePattern.size() = "+choosePattern.size());
Log.d(TAG, "choosePattern = "+Arrays.toString(choosePattern.toArray()));
step = STEP_2;
updateView();
return;
}
//[(row=1,clmn=0), (row=2,clmn=0), (row=1,clmn=1), (row=0,clmn=2)]
//[(row=1,clmn=0), (row=2,clmn=0), (row=1,clmn=1), (row=0,clmn=2)]
Log.d(TAG, "choosePattern = "+Arrays.toString(choosePattern.toArray()));
Log.d(TAG, "pattern = "+Arrays.toString(pattern.toArray()));
if (choosePattern.equals(pattern)) {
// Log.d(TAG, "pattern = "+pattern.toString());
// Log.d(TAG, "pattern.size() = "+pattern.size());
Log.d(TAG, "pattern = "+Arrays.toString(pattern.toArray()));
confirm = true;
} else {
confirm = false;
}
step = STEP_4;
updateView();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,206 @@
package net.oschina.app.addfunctions;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import net.oschina.app.R;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
//to add
import net.oschina.app.addfunctions.LockPatternView.Cell;
import net.oschina.app.addfunctions.LockPatternView.DisplayMode;
//use these codes from "schemas.android.com"
//Thanks to the great Internet
public class LockSetupActivity extends Activity implements LockPatternView.OnPatternListener, OnClickListener {
private static final String TAG = "LockSetupActivity";
private LockPatternView lockPatternView;
private Button leftButton;
private Button rightButton;
private static final int STEP_1 = 1; // 开始
private static final int STEP_2 = 2; // 第一次设置手势完成
private static final int STEP_3 = 3; // 按下继续按钮
private static final int STEP_4 = 4; // 第二次设置手势完成
// private static final int SETP_5 = 4; // 按确认按钮
private int step;
private List<Cell> choosePattern;
private boolean confirm = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lock_setup);
lockPatternView = (LockPatternView) findViewById(R.id.lock_pattern);
lockPatternView.setOnPatternListener(this);
leftButton = (Button) findViewById(R.id.left_btn);
rightButton = (Button) findViewById(R.id.right_btn);
step = STEP_1;
updateView();
}
private void updateView() {
switch (step) {
case STEP_1:
leftButton.setText(R.string.cancel);
rightButton.setText("");
rightButton.setEnabled(false);
choosePattern = null;
confirm = false;
lockPatternView.clearPattern();
lockPatternView.enableInput();
break;
case STEP_2:
leftButton.setText(R.string.try_again);
rightButton.setText(R.string.goon);
rightButton.setEnabled(true);
lockPatternView.disableInput();
break;
case STEP_3:
leftButton.setText(R.string.cancel);
rightButton.setText("");
rightButton.setEnabled(false);
lockPatternView.clearPattern();
lockPatternView.enableInput();
break;
case STEP_4:
leftButton.setText(R.string.cancel);
if (confirm) {
rightButton.setText(R.string.confirm);
rightButton.setEnabled(true);
lockPatternView.disableInput();
} else {
rightButton.setText("");
lockPatternView.setDisplayMode(DisplayMode.Wrong);
lockPatternView.enableInput();
rightButton.setEnabled(false);
}
break;
default:
break;
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.left_btn:
if (step == STEP_1 || step == STEP_3 || step == STEP_4) {
finish();
} else if (step == STEP_2) {
step = STEP_1;
updateView();
}
break;
case R.id.right_btn:
if (step == STEP_2) {
step = STEP_3;
updateView();
} else if (step == STEP_4) {
SharedPreferences preferences = getSharedPreferences(
gesturelockMainActivity.LOCK, MODE_PRIVATE);
preferences
.edit()
.putString(gesturelockMainActivity.LOCK_KEY,
LockPatternView.patternToString(choosePattern))
.commit();
//Intent intent = new Intent(this, lockActivity.class);
//startActivity(intent);
finish();
}
break;
default:
break;
}
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
@Override
public void onPatternStart() {
Log.d(TAG, "onPatternStart");
}
@Override
public void onPatternCleared() {
Log.d(TAG, "onPatternCleared");
}
@Override
public void onPatternCellAdded(List<Cell> pattern) {
Log.d(TAG, "onPatternCellAdded");
}
@Override
public void onPatternDetected(List<Cell> pattern) {
Log.d(TAG, "onPatternDetected");
if (pattern.size() < LockPatternView.MIN_LOCK_PATTERN_SIZE) {
Toast.makeText(this,
R.string.lockpattern_recording_incorrect_too_short,
Toast.LENGTH_LONG).show();
lockPatternView.setDisplayMode(DisplayMode.Wrong);
return;
}
if (choosePattern == null) {
choosePattern = new ArrayList<Cell>(pattern);
// Log.d(TAG, "choosePattern = "+choosePattern.toString());
// Log.d(TAG, "choosePattern.size() = "+choosePattern.size());
Log.d(TAG, "choosePattern = "+Arrays.toString(choosePattern.toArray()));
step = STEP_2;
updateView();
return;
}
//[(row=1,clmn=0), (row=2,clmn=0), (row=1,clmn=1), (row=0,clmn=2)]
//[(row=1,clmn=0), (row=2,clmn=0), (row=1,clmn=1), (row=0,clmn=2)]
Log.d(TAG, "choosePattern = "+Arrays.toString(choosePattern.toArray()));
Log.d(TAG, "pattern = "+Arrays.toString(pattern.toArray()));
if (choosePattern.equals(pattern)) {
// Log.d(TAG, "pattern = "+pattern.toString());
// Log.d(TAG, "pattern.size() = "+pattern.size());
Log.d(TAG, "pattern = "+Arrays.toString(pattern.toArray()));
confirm = true;
} else {
confirm = false;
}
step = STEP_4;
updateView();
}
}

View File

@ -0,0 +1,84 @@
package net.oschina.app.addfunctions;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import net.oschina.app.AppConfig;
import net.oschina.app.AppContext;
import net.oschina.app.AppManager;
import net.oschina.app.AppStart;
import net.oschina.app.R;
import net.oschina.app.base.BaseFragment;
import net.oschina.app.bean.SimpleBackPage;
import net.oschina.app.util.DialogHelp;
import net.oschina.app.util.FileUtil;
import net.oschina.app.util.MethodsCompat;
import net.oschina.app.util.UIHelper;
import net.oschina.app.widget.togglebutton.ToggleButton;
import net.oschina.app.widget.togglebutton.ToggleButton.OnToggleChanged;
import org.kymjs.kjframe.http.HttpConfig;
import butterknife.ButterKnife;
public class chooseTextSizeActivity extends Activity implements View.OnClickListener {
// 12-01 18:26:09.907: I/ActivityManager(519): Displayed
// com.android.settings/.ChooseLockPattern: +236ms
// 12-01 19:35:14.870: I/ActivityManager(519): Displayed
// com.android.settings/.ConfirmLockPattern: +366ms (total +439ms)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choose_text_size);
}
public void initView(View view) {
view.findViewById(R.id.rl_small).setOnClickListener(this);
view.findViewById(R.id.rl_meduim).setOnClickListener(this);
view.findViewById(R.id.rl_big).setOnClickListener(this);
view.findViewById(R.id.rl_large).setOnClickListener(this);
}
public void onClick(View v) {
final int id = v.getId();
switch (id) {
case R.id.rl_small:
break;
case R.id.rl_meduim:
break;
case R.id.rl_big:
break;
case R.id.rl_large:
break;
default:
break;
}
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
}

View File

@ -0,0 +1,71 @@
package net.oschina.app.addfunctions;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
import net.oschina.app.R;
import net.oschina.app.AppStart;
public class gesturelockMainActivity extends Activity implements OnClickListener {
// 12-01 18:26:09.907: I/ActivityManager(519): Displayed
// com.android.settings/.ChooseLockPattern: +236ms
// 12-01 19:35:14.870: I/ActivityManager(519): Displayed
// com.android.settings/.ConfirmLockPattern: +366ms (total +439ms)
private static final String TAG = "MainActivity";
public static final String LOCK = "lock";
public static final String LOCK_KEY = "lock_key";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gesturelock_main);
SharedPreferences preferences = getSharedPreferences(LOCK, MODE_PRIVATE);
String lockPattenString = preferences.getString(LOCK_KEY, null);
if (lockPattenString != null) {
AppStart.from_top = 0;
Intent intent = new Intent(this, lockActivity.class);
startActivity(intent);
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.lock:
Intent intent = new Intent(this, LockSetupActivity.class);
startActivity(intent);
break;
case R.id.unlock:
getSharedPreferences(LOCK, MODE_PRIVATE).edit().clear().commit();
Toast.makeText(this,
R.string.cancel_successful,
Toast.LENGTH_LONG).show();
break;
default:
break;
}
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
}

View File

@ -0,0 +1,106 @@
package net.oschina.app.addfunctions;
import java.util.List;
import net.oschina.app.AppStart;
import net.oschina.app.R;
import net.oschina.app.addfunctions.LockPatternView.Cell;
import net.oschina.app.addfunctions.LockPatternView.DisplayMode;
import net.oschina.app.ui.MainActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.content.SharedPreferences;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.widget.Toast;
public class lockActivity extends Activity implements
LockPatternView.OnPatternListener {
private static final String TAG = "LockActivity";
private List<Cell> lockPattern;
private LockPatternView lockPatternView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences preferences = getSharedPreferences(gesturelockMainActivity.LOCK,
MODE_PRIVATE);
String patternString = preferences.getString(gesturelockMainActivity.LOCK_KEY,
null);
if (patternString == null) {
finish();
return;
}
lockPattern = LockPatternView.stringToPattern(patternString);
setContentView(R.layout.activity_lock);
lockPatternView = (LockPatternView) findViewById(R.id.lock_pattern);
lockPatternView.setOnPatternListener(this);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// disable back key
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
return super.onKeyDown(keyCode, event);
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// // Inflate the menu; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
@Override
public void onPatternStart() {
Log.d(TAG, "onPatternStart");
}
@Override
public void onPatternCleared() {
Log.d(TAG, "onPatternCleared");
}
@Override
public void onPatternCellAdded(List<Cell> pattern) {
Log.d(TAG, "onPatternCellAdded");
Log.e(TAG, LockPatternView.patternToString(pattern));
// Toast.makeText(this, LockPatternView.patternToString(pattern),
// Toast.LENGTH_LONG).show();
}
@Override
public void onPatternDetected(List<Cell> pattern) {
Log.d(TAG, "onPatternDetected");
if (pattern.equals(lockPattern)) {
if(AppStart.from_top == 1) {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
finish();
} else {
lockPatternView.setDisplayMode(DisplayMode.Wrong);
Toast.makeText(this, R.string.lockpattern_error, Toast.LENGTH_LONG)
.show();
}
}
}

View File

@ -0,0 +1,45 @@
package net.oschina.app.service;
/**
* Created by panyang on 2016/11/23.
*/
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import net.oschina.app.R;
import android.os.IBinder;
public class MusicService extends Service {
private MediaPlayer mediaPlayer = null;
@Override
//与activity进行绑定
public IBinder onBind(Intent intent) {
return null;
}
@Override
//服务的启动
public void onCreate() {
super.onCreate();
//利用内置的多媒体播放模块播放音乐
if (mediaPlayer == null) {
mediaPlayer = MediaPlayer.create(this, R.raw.abc);
mediaPlayer.setLooping(true);
}
}
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
mediaPlayer.start();
}
@Override
public void onDestroy() {
super.onDestroy();
mediaPlayer.stop();
}
}

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="?attr/layout_item_bg"
android:orientation="vertical"
android:scrollbars="none"
tools:context="net.oschina.app.addfunctions.chooseTextSizeActivity">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
style="@style/h_line"
android:layout_marginTop="20dip" />
<RelativeLayout
android:id="@+id/rl_empty_button"
style="@style/option_item_rl">
<TextView
style="@style/option_item_text_parent"
android:text="@string/title_choose_size"
android:textColor="?attr/textColor"
android:textSize="@dimen/text_size_16" />
</RelativeLayout>
<View
style="@style/h_line"
android:layout_marginTop="20dip" />
<View
style="@style/h_line"
android:layout_marginTop="20dip" />
<View style="@style/h_line" />
<RelativeLayout
android:id="@+id/rl_small"
style="@style/option_item_rl">
<TextView
style="@style/option_item_text_parent"
android:text="@string/small_size"
android:textColor="?attr/textColor"
android:textSize="@dimen/text_size_16" />
</RelativeLayout>
<View style ="@style/h_line" />
<RelativeLayout
android:id="@+id/rl_meduim"
style="@style/option_item_rl">
<TextView
style="@style/option_item_text_parent"
android:text="@string/medium_size"
android:textColor="?attr/textColor"
android:textSize="16.0dip"/>
</RelativeLayout>>
<View style ="@style/h_line" />
<RelativeLayout
android:id="@+id/rl_big"
style="@style/option_item_rl">
<TextView
style="@style/option_item_text_parent"
android:text="@string/big_size"
android:textColor="?attr/textColor"
android:textSize="16.0dip"/>
</RelativeLayout>>
<View style="@style/h_line" />
<RelativeLayout
android:id="@+id/rl_large"
style="@style/option_item_rl">
<TextView
android:id="@+id/setting_logout"
style="@style/option_item_text_parent"
android:text="@string/large_size"
android:textColor="?attr/textColor"
android:textSize="@dimen/text_size_16" />
</RelativeLayout>
<View style="@style/h_line" />
</LinearLayout>
</ScrollView>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#003333"
tools:context="net.oschina.app.addfunctions.gesturelockMainActivity">
<Button
android:id="@+id/lock"
android:layout_width="150dip"
android:layout_height="100dip"
android:textSize="25dip"
android:onClick="onClick"
android:text="设置手势锁"
/>
<Button
android:id="@+id/unlock"
android:layout_width="150dip"
android:layout_height="100dip"
android:textSize="25dip"
android:onClick="onClick"
android:text="取消手势锁"
android:layout_marginTop="41dp" android:layout_below="@+id/lock"
android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/>
</RelativeLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#003333"
tools:context="net.oschina.app.LockPattern.LockPatternMainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text = "请输入手势密码"
android:textSize="25sp"
android:textColor="#ffffff"
android:id="@+id/textView3" android:layout_above="@+id/lock_pattern"
/>
<net.oschina.app.LockPattern.LockPatternView
android:id = "@+id/lock_pattern"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
</RelativeLayout>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#003333"
tools:context="net.oschina.app.addfunctions.gesturelockMainActivity">
<net.oschina.app.addfunctions.LockPatternView
android:id="@id/lock_pattern"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayout" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_marginTop="29dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/linearLayout">
<Button
android:id="@+id/left_btn"
android:layout_width="5dip"
android:layout_height="68dp"
android:layout_weight="4.76"
android:onClick="onClick" />
<Button
android:id="@+id/right_btn"
android:layout_width="5dip"
android:layout_height="match_parent"
android:layout_weight="5.00"
android:onClick="onClick" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#003333"
tools:context="net.oschina.app.LockPattern.LockPatternMainActivity">
<Button
android:id="@+id/lock"
android:layout_width="150dip"
android:layout_height="100dip"
android:textSize="25dip"
android:onClick="onClick"
android:text="设置手势锁"
/>
<Button
android:id="@+id/unlock"
android:layout_width="150dip"
android:layout_height="100dip"
android:textSize="25dip"
android:onClick="onClick"
android:text="取消手势锁"
android:layout_marginTop="41dp" android:layout_below="@+id/lock"
android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/>
</RelativeLayout>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#003333"
tools:context="net.oschina.app.LockPattern.LockPatternMainActivity">
<net.oschina.app.LockPattern.LockPatternView
android:id="@id/lock_pattern"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayout" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_marginTop="29dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/linearLayout">
<Button
android:id="@+id/left_btn"
android:layout_width="5dip"
android:layout_height="68dp"
android:layout_weight="4.76"
android:onClick="onClick" />
<Button
android:id="@+id/right_btn"
android:layout_width="5dip"
android:layout_height="match_parent"
android:layout_weight="5.00"
android:onClick="onClick" />
</LinearLayout>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

90
android-app/gradlew.bat vendored Normal file
View File

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Binary file not shown.

Binary file not shown.