-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
185 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
app/src/main/java/com/sdwfqin/quickseed/ui/components/WebViewMainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.sdwfqin.quickseed.ui.components; | ||
|
||
import android.widget.ArrayAdapter; | ||
|
||
import com.alibaba.android.arouter.facade.annotation.Route; | ||
import com.alibaba.android.arouter.launcher.ARouter; | ||
import com.sdwfqin.quicklib.base.BaseActivity; | ||
import com.sdwfqin.quicklib.base.QuickConstants; | ||
import com.sdwfqin.quicklib.webview.QuickWebViewActivity; | ||
import com.sdwfqin.quicklib.webview.QuickWebViewLoadDataActivity; | ||
import com.sdwfqin.quickseed.R; | ||
import com.sdwfqin.quickseed.base.ArouterConstants; | ||
import com.sdwfqin.quickseed.databinding.ActivitySampleListBinding; | ||
|
||
/** | ||
* WebView示例 | ||
* <p> | ||
* | ||
* @author 张钦 | ||
* @date 2020/5/27 | ||
*/ | ||
@Route(path = ArouterConstants.COMPONENTS_WEBVIEW) | ||
public class WebViewMainActivity extends BaseActivity<ActivitySampleListBinding> { | ||
|
||
private String[] mTitle = new String[]{ | ||
"默认", | ||
"自定义", | ||
"加载本地html" | ||
}; | ||
|
||
@Override | ||
protected ActivitySampleListBinding getViewBinding() { | ||
return ActivitySampleListBinding.inflate(getLayoutInflater()); | ||
} | ||
|
||
@Override | ||
protected void initEventAndData() { | ||
mTopBar.setTitle("WebView Demo"); | ||
mTopBar.addLeftBackImageButton().setOnClickListener(v -> finish()); | ||
|
||
mBinding.list.setAdapter(new ArrayAdapter<>(mContext, R.layout.item_list, R.id.tv_items, mTitle)); | ||
} | ||
|
||
@Override | ||
protected void initClickListener() { | ||
mBinding.list.setOnItemClickListener((adapterView, view, i, l) -> { | ||
switch (i) { | ||
case 0: | ||
QuickWebViewActivity.launch("https://www.baidu.com"); | ||
break; | ||
case 1: | ||
ARouter.getInstance().build(ArouterConstants.COMPONENTS_CUSTOMWEBVIEW).navigation(); | ||
break; | ||
case 2: | ||
QuickWebViewLoadDataActivity.launch(null, "测试标题", QuickConstants.HEAD + "哈哈哈哈" + QuickConstants.END, false); | ||
break; | ||
default: | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ListView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/list" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.