Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

photoBitmap不可能为空,不需检查 #2

Merged
merged 4 commits into from
Jul 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ZBLibrary(AndroidStudio)/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions ZBLibrary(AndroidStudio)/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ZBLibrary(AndroidStudio)/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions ZBLibrary(AndroidStudio)/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions ZBLibrary(AndroidStudio)/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions ZBLibrary(AndroidStudio)/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions ZBLibrary(AndroidStudio)/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void finish() {
/**计时器holder
*/
@SuppressLint("HandlerLeak")
public class TimeHolder {
public static class TimeHolder {

long duration = 1000;
OnTimeRefreshListener listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void onClick(View v) {
return convertView;
}

public class ViewHolder {
public static class ViewHolder {
public ImageView ivHead;
public TextView tvName;
public ImageView ivCheck;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void onClick(View v) {
return convertView;
}

public class ViewHolder {
public static class ViewHolder {
public TextView tv;
}
//getView的常规写法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public View getView(final int position, View convertView, ViewGroup parent) {
return convertView;
}

public class ViewHolder {
public static class ViewHolder {
public TextView tvKey;
public TextView tvValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ public static String savePhotoToSDCard(String path, String photoName, String for
FileOutputStream fileOutputStream = null;
try {
fileOutputStream = new FileOutputStream(photoFile);
if (photoBitmap != null) {

if (photoBitmap.compress(Bitmap.CompressFormat.JPEG, 100,
fileOutputStream)) {
fileOutputStream.flush();
Log.i(TAG, "savePhotoToSDCard<<<<<<<<<<<<<<\n" + photoFile.getAbsolutePath() + "\n>>>>>>>>> succeed!");
}

}
} catch (FileNotFoundException e) {
Log.e(TAG, "savePhotoToSDCard catch (FileNotFoundException e) {\n " + e.getMessage());
Expand All @@ -388,6 +388,7 @@ public static String savePhotoToSDCard(String path, String photoName, String for
// e.printStackTrace();
} finally {
try {
if (null!=fileOutputStream)
fileOutputStream.close();
} catch (IOException e) {
Log.e(TAG, "savePhotoToSDCard } catch (IOException e) {\n " + e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ private void addList() {
list = new ArrayList<>();
}
list.addAll(getList(userId));
if (null!=adapter)
adapter.refresh(list);

lvDemo.smoothScrollToPosition(formerCout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public View getView(final int position, View convertView, ViewGroup parent) {
//示例代码>>>>>>>>>>>>>>>>
}

class ViewHolder {
static class ViewHolder {
//示例代码<<<<<<<<<<<<<<<<
public ImageView ivDemoItemHead;
public TextView tvDemoItemName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ItemView createView(int position, View convertView, ViewGroup parent) {
/**item对应的View,可改为外部类
* @use 改代码
*/
public class ItemView extends BaseView<Entry<String, String>> implements OnClickListener {
public static class ItemView extends BaseView<Entry<String, String>> implements OnClickListener {
private static final String TAG = "ItemView";

public ItemView(Activity context, Resources resources) {
Expand Down