parent
52a4f1e7ea
commit
1764f50258
@ -0,0 +1,9 @@ |
||||
package com.arialyy.aria.core.inf; |
||||
|
||||
/** |
||||
* Created by lyy on 2017/6/3. |
||||
*/ |
||||
public abstract class AbsTask implements ITask{ |
||||
|
||||
|
||||
} |
@ -1,67 +0,0 @@ |
||||
/* |
||||
* Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria)
|
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package com.arialyy.aria.window; |
||||
|
||||
import android.os.Bundle; |
||||
import android.os.Environment; |
||||
import android.support.annotation.Nullable; |
||||
import android.support.v4.app.FragmentActivity; |
||||
import android.widget.AbsListView; |
||||
import android.widget.ListView; |
||||
import com.arialyy.aria.R; |
||||
import com.arialyy.aria.util.FileUtil; |
||||
import java.io.File; |
||||
import java.util.ArrayList; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* Created by lyy on 2017/3/21. |
||||
* 文件选择 |
||||
*/ |
||||
class AriaFileChangeActivity extends FragmentActivity { |
||||
final String ROOT_PAT = Environment.getExternalStorageDirectory().getPath(); |
||||
ListView mList; |
||||
FileChangeAdapter mAdapter; |
||||
Map<String, List<FileEntity>> mData = new HashMap<>(); |
||||
private String mCurrentPath = ROOT_PAT; |
||||
|
||||
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
setContentView(R.layout.activity_aria_file_shange); |
||||
mList = (ListView) findViewById(R.id.list); |
||||
mList.setOnScrollListener(new AbsListView.OnScrollListener() { |
||||
int state; |
||||
|
||||
@Override public void onScrollStateChanged(AbsListView view, int scrollState) { |
||||
state = scrollState; |
||||
} |
||||
|
||||
@Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, |
||||
int totalItemCount) { |
||||
if (state == AbsListView.OnScrollListener.SCROLL_STATE_IDLE |
||||
&& firstVisibleItem + visibleItemCount == totalItemCount) { |
||||
loadMore(); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void loadMore() { |
||||
|
||||
} |
||||
} |
@ -1,92 +0,0 @@ |
||||
/* |
||||
* Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria)
|
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package com.arialyy.aria.window; |
||||
|
||||
import android.content.Context; |
||||
import android.util.SparseBooleanArray; |
||||
import android.view.LayoutInflater; |
||||
import android.view.View; |
||||
import android.view.ViewGroup; |
||||
import android.widget.BaseAdapter; |
||||
import android.widget.CheckBox; |
||||
import android.widget.ImageView; |
||||
import android.widget.TextView; |
||||
import com.arialyy.aria.R; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by lyy on 2017/3/21. |
||||
*/ |
||||
final class FileChangeAdapter extends BaseAdapter { |
||||
|
||||
List<FileEntity> mData = new ArrayList<>(); |
||||
SparseBooleanArray mCheck = new SparseBooleanArray(); |
||||
Context mContext; |
||||
|
||||
public FileChangeAdapter(Context context, List<FileEntity> list) { |
||||
mContext = context; |
||||
mData.addAll(list); |
||||
for (int i = 0, len = mData.size(); i < len; i++) { |
||||
mCheck.append(i, false); |
||||
} |
||||
} |
||||
|
||||
@Override public int getCount() { |
||||
return mData.size(); |
||||
} |
||||
|
||||
@Override public Object getItem(int position) { |
||||
return null; |
||||
} |
||||
|
||||
@Override public long getItemId(int position) { |
||||
return 0; |
||||
} |
||||
|
||||
@Override public View getView(int position, View convertView, ViewGroup parent) { |
||||
FileChangeHolder holder = null; |
||||
if (convertView == null) { |
||||
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_file, null); |
||||
holder = new FileChangeHolder(convertView); |
||||
convertView.setTag(holder); |
||||
} else { |
||||
holder = (FileChangeHolder) convertView.getTag(); |
||||
} |
||||
|
||||
holder.checkBox.setChecked(mCheck.get(position, false)); |
||||
return convertView; |
||||
} |
||||
|
||||
public void setCheck(int position, boolean check) { |
||||
if (position >= mData.size()) return; |
||||
mCheck.put(position, check); |
||||
notifyDataSetChanged(); |
||||
} |
||||
|
||||
private static class FileChangeHolder { |
||||
TextView title, info; |
||||
ImageView icon; |
||||
CheckBox checkBox; |
||||
|
||||
FileChangeHolder(View view) { |
||||
title = (TextView) view.findViewById(R.id.title); |
||||
info = (TextView) view.findViewById(R.id.info); |
||||
icon = (ImageView) view.findViewById(R.id.icon); |
||||
checkBox = (CheckBox) view.findViewById(R.id.checkbox); |
||||
} |
||||
} |
||||
} |
@ -1,29 +0,0 @@ |
||||
/* |
||||
* Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria)
|
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package com.arialyy.aria.window; |
||||
|
||||
import android.graphics.drawable.Drawable; |
||||
|
||||
/** |
||||
* Created by lyy on 2017/3/21. |
||||
*/ |
||||
|
||||
class FileEntity { |
||||
public String fileName; |
||||
public String fileInfo; |
||||
public int fileIcon; |
||||
public Drawable fileDrawable; |
||||
} |
@ -0,0 +1,38 @@ |
||||
package com.arialyy.simple.common; |
||||
|
||||
import android.annotation.SuppressLint; |
||||
import android.os.Bundle; |
||||
import butterknife.OnClick; |
||||
import com.arialyy.frame.util.show.T; |
||||
import com.arialyy.simple.R; |
||||
import com.arialyy.simple.base.BaseDialog; |
||||
import com.arialyy.simple.databinding.DialogMsgBinding; |
||||
|
||||
/** |
||||
* Created by AriaL on 2017/6/3. |
||||
*/ |
||||
@SuppressLint("ValidFragment") public class MsgDialog extends BaseDialog<DialogMsgBinding> { |
||||
|
||||
private String mTitle, mMsg; |
||||
|
||||
public MsgDialog(Object obj, String title, String msg) { |
||||
super(obj); |
||||
mTitle = title; |
||||
mMsg = msg; |
||||
} |
||||
|
||||
@Override protected void init(Bundle savedInstanceState) { |
||||
super.init(savedInstanceState); |
||||
getBinding().setTitle(mTitle); |
||||
getBinding().setMsg(mMsg); |
||||
} |
||||
|
||||
@Override protected int setLayoutId() { |
||||
return R.layout.dialog_msg; |
||||
} |
||||
|
||||
@OnClick(R.id.enter) |
||||
public void close(){ |
||||
dismiss(); |
||||
} |
||||
} |
@ -0,0 +1,63 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<data> |
||||
<variable |
||||
name="title" |
||||
type="java.lang.String" |
||||
/> |
||||
<variable |
||||
name="msg" |
||||
type="java.lang.String" |
||||
/> |
||||
</data> |
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="@color/white" |
||||
android:orientation="vertical" |
||||
> |
||||
|
||||
|
||||
<TextView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="@color/background_color" |
||||
android:gravity="center|left" |
||||
android:maxHeight="400dp" |
||||
android:padding="8dp" |
||||
android:text="@{title}" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="22sp" |
||||
/> |
||||
|
||||
<ScrollView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:maxHeight="400dp" |
||||
> |
||||
<TextView |
||||
android:id="@+id/msg" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginBottom="15dp" |
||||
android:layout_marginLeft="16dp" |
||||
android:layout_marginRight="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:gravity="center_vertical|left" |
||||
android:lineSpacingMultiplier="1.2" |
||||
android:text="@{msg}" |
||||
android:textColor="#000" |
||||
android:textSize="16sp" |
||||
/> |
||||
</ScrollView> |
||||
|
||||
<Button |
||||
android:id="@+id/enter" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:text="确定" |
||||
style="?buttonBarButtonStyle" |
||||
/> |
||||
|
||||
</LinearLayout> |
||||
</layout> |
@ -0,0 +1,21 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto"> |
||||
|
||||
<item |
||||
android:id="@+id/add_task" |
||||
android:icon="@mipmap/ic_add_black_48dp" |
||||
android:orderInCategory="80" |
||||
android:title="添加一组任务" |
||||
app:showAsAction="ifRoom" |
||||
/> |
||||
|
||||
<item |
||||
android:id="@+id/help" |
||||
android:icon="@mipmap/ic_help_black_48dp" |
||||
android:orderInCategory="90" |
||||
android:title="最高优先级任务介绍" |
||||
app:showAsAction="ifRoom" |
||||
/> |
||||
|
||||
</menu> |
After Width: | Height: | Size: 199 B |
After Width: | Height: | Size: 578 B |
Loading…
Reference in new issue