Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
第一次提交☝️
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoweihaoChina committed Apr 10, 2018
0 parents commit 4189314
Show file tree
Hide file tree
Showing 431 changed files with 8,608 additions and 0 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2017 Zhao Weihao

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Second-hand transactions

# 校园二手交易

## 总结

总结:这是我大半年前学校移动开发课的期末作业,一开始是做的校园社区APP,后来修改为校园二手交易,由于需求的变化和之前的水平比较水,当时又是刚开始学Kotlin就拿来用了,并且还没有学习架构,所以这个项目的整体结构比较混乱,代码比较难看🤢;但是还是留着做个纪念吧,毕竟这个APP也让我学习到了蛮多东西的,让我认识到写优秀代码的重要性,让我知道我有哪里的不足,同时也让我深度体验了一回Bmob后端云SDK的运用;在不会后端的前提下,运用后端云SDK蛮方便就是受制于SDK的功能性,SDK有提供就有没有就没有,这也是让我非常惆怅的。还是有闲的话自己搞后端比较好。推荐使用[Blade](https://github.com/lets-blade/blade)(Java)做简单的后端API,我上手了一下感觉很容易入门,非常适合我。好了~,要继续提升自己了。多看看别人优秀的代码后发现自己写的真的好水啊。。。

## 运行截图

| 主界面 | 公开评论界面 | 实时聊天界面 | 消息界面 |
| :-----------------------------: | :-------------------------------------: | :-------------------------------------: | :---------------------------------: |
| ![主界面](./art/主界面.png) | ![公开评论界面](./art/公开评论界面.png) | ![实时聊天界面](./art/实时聊天界面.png) | ![消息页面后](./art/消息页面后.png) |
| **翻译功能** | **天气功能** | **云笔记功能** | **登录界面** |
| ![翻译界面](./art/翻译界面.png) | ![天气界面](./art/天气界面.png) | ![云笔记界面](./art/云笔记界面.png) | ![登录界面](./art/登录界面.png) |

## 关于我

简要介绍:一个大三的有志小青年,梦想是改变世界(Change the world),哈哈😄,梦想很伟大。从小事一点点做起吧,做个对社会有贡献的人就好了。

如何找到我:📮邮箱:[email protected](自从发现foxmail不能收到某些邮件我就果断改用gmail了)

状态:目前可以接受暑期实习,大概七月份左右可以实习,这段时间我会尽量提升自己,如果有大佬看上我,可以给我个机会,非常期待你的邮件。

附上简历📖:[简历](http://zhaoweihao.com/resume/xxx.pdf)



## 谢谢!
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
200 changes: 200 additions & 0 deletions app/app.iml

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "me.zhaoweihao.hnuplus"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'cn.bmob.android:bmob-im:2.0.9@aar'
compile 'cn.bmob.android:bmob-sdk:3.5.5'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'cn.bmob.android:http-legacy:1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.android.support:design:26.1.0'
compile 'com.yalantis:phoenix:1.2.3'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.jakewharton:butterknife:8.8.1'
compile "org.jetbrains.anko:anko-commons:0.10.2"
compile 'com.github.yoavst:androidKotlin:1.5.1'
compile 'com.zhihu.android:matisse:0.4.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.chrisbanes:PhotoView:2.1.3'
compile 'nl.dionsegijn:konfetti:1.1.0'
compile 'com.github.pwittchen:weathericonview:1.1.0'
compile 'com.taishi-y:flipprogressdialog:0.1.0'
compile 'com.lzy.widget:ninegridview:0.2.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
}
Binary file not shown.
29 changes: 29 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\Administrator\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontwarn com.squareup.picasso.**

-keepclassmembers class ** {
public void on*Event(...);
}
-keep class c.t.**{*;}
-keep class com.tencent.map.geolocation.**{*;}
-keep class com.tencent.tencentmap.lbssdk.service.**{*;}


-dontwarn org.eclipse.jdt.annotation.**
-dontwarn c.t.**
1 change: 1 addition & 0 deletions app/release/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"me.zhaoweihao.hnuplus","split":"","minSdkVersion":"19"}}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package me.zhaoweihao.hnuplus

import android.content.Context
import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumentation test, which will execute on an Android device.
* @see [Testing documentation](http://d.android.com/tools/testing)
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
@Throws(Exception::class)
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()

assertEquals("me.zhaoweihao.hnuplus", appContext.packageName)
}
}
91 changes: 91 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.zhaoweihao.hnuplus">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!-- 腾讯定位SDK所需要的权限 -->
<!-- 通过GPS得到精确位置 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- 通过网络得到粗略位置 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- 修改WiFi状态,发起WiFi扫描, 需要WiFi信息用于网络定位 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- 访问网络的变化, 需要某些信息用于网络定位 -->
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<!-- 摄像头 -->
<uses-permission android:name="android.permission.CAMERA" />
<!-- 录音 -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- 通知震动 -->
<uses-permission android:name="android.permission.VIBRATE" />

<application
android:name=".BmobIMApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="TencentMapSDK"
android:value="YBYBZ-HFJRF-WVPJC-JK4ID-DRF57-CTFJ2" />
<!-- TODO 集成:1.3、配置Bmob平台的应用密钥 -->
<meta-data
android:name="Bmob_APP_KEY"
android:value="06f45f723f43d1b79d4c56798abff251" />

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PostActivity"
android:theme="@style/MyTheme" />
<activity android:name=".CommentActivity" />
<activity
android:name=".SigninActivity"
android:theme="@style/Theme.AppTheme.TranslucentStatusBar" />
<activity android:name=".WeatherActivity" />
<activity android:name=".NoteActivity" />
<activity android:name=".NoteEditActivity" />
<activity android:name=".TranslateActivity" />
<activity android:name=".ChatActivity" />

<!-- TODO 集成:1.5、配置IM SDK需要的广播和服务 -->
<receiver android:name="cn.bmob.newim.core.ConnectChangeReceiver">
<intent-filter>
<action android:name="cn.bmob.action.RECONNECT" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>

<service
android:name="cn.bmob.newim.core.service.BmobIMService"
android:process=":bmobcore" />
<service
android:name="cn.bmob.newim.core.service.NotifyService"
android:process=":bmobcore" />
<service android:name="cn.bmob.newim.core.service.ReConnectService" />
<service android:name="cn.bmob.newim.core.service.HeartBeatService" />

<activity android:name=".BuyActivity" />
<activity android:name=".OrderActivity" />
<activity android:name=".MyOrderActivity" />
<activity android:name=".GetOrderActivity" />
<activity android:name=".PersonalActivity"></activity>
</application>

</manifest>
59 changes: 59 additions & 0 deletions app/src/main/java/me/zhaoweihao/hnuplus/Adapter/CommentAdapter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package me.zhaoweihao.hnuplus.Adapter

import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import com.squareup.picasso.Picasso

import me.zhaoweihao.hnuplus.Bmob.Comment
import me.zhaoweihao.hnuplus.R

/**
* Created by ZhaoWeihao on 2017/11/10.
*/

/**
* Show comment's data to recyclerview
*/
class CommentAdapter(private val mCommentList: List<Comment>) : RecyclerView.Adapter<CommentAdapter.ViewHolder>() {

companion object {
private val TAG = "CommentAdapter"
}

private var mContext: Context? = null

class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
var commentatorName = view.findViewById<TextView>(R.id.tv_commentator_name)
var commentatorContent = view.findViewById<TextView>(R.id.tv_commentator_content)
var commentAvatar = view.findViewById<ImageView>(R.id.iv_avatar)
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
if (mContext == null) {
mContext = parent.context
}
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.comments_item, parent, false)
return ViewHolder(view)
}

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val comment = mCommentList[position]
holder.commentatorName.text = comment.user!!.username
holder.commentatorContent.text = comment.content
Picasso.with(mContext)
.load(comment.user!!.userAvatar)
.resize(40, 40)
.centerCrop()
.into(holder.commentAvatar)
}

override fun getItemCount(): Int {
return mCommentList.size
}
}
Loading

0 comments on commit 4189314

Please sign in to comment.