Skip to content

Commit

Permalink
Update to android8.0.
Browse files Browse the repository at this point in the history
In fact, I have do nothig,besides update dependencies.
  • Loading branch information
DawningW committed Aug 1, 2017
1 parent 80816d3 commit b3cb9d9
Show file tree
Hide file tree
Showing 29 changed files with 161 additions and 113 deletions.
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# Dawn-Launcher-Android
# 曙光工艺启动器安卓版-曙光助手

A game launcher for android under GPLv3
一个使用GPLv3开源协议的游戏启动器

It is WIP.
它还在制作当中,并且目前进度缓慢

If you want to join us, we are welcome.
我们欢迎您加入我们的工作室
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "io.github.dawncraft.dawnlauncher"
applicationId 'io.github.dawncraft.launcher'
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "0.0.1.0"
targetSdkVersion 26
versionCode 2
versionName '0.0.1.1'
vectorDrawables.useSupportLibrary = true
}
buildTypes {
Expand All @@ -17,18 +17,18 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:support-vector-drawable:26.0.0-alpha1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.jakewharton:butterknife:5.1.1'
compile 'com.ashokvarma.android:bottom-navigation-bar:1.4.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.squareup.okhttp3:mockwebserver:3.6.0'
Expand Down
10 changes: 4 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.github.dawncraft.dawnlauncher">
package="io.github.dawncraft.launcher">

<!-- 获取系统相机与闪光灯使用权限 -->
<uses-permission android:name="android.permission.CAMERA" />
Expand Down Expand Up @@ -45,15 +45,13 @@
<activity
android:name=".ui.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">

</activity>
android:theme="@style/AppTheme.NoActionBar"></activity>
<!-- 登录界面 -->
<!-- 设置界面 -->
<activity
android:name=".ui.SettingsActivity"
android:label="@string/title_activity_settings"
android:theme="@style/AppTheme">
</activity>
android:theme="@style/AppTheme"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.dawncraft.dawnlauncher;
package io.github.dawncraft.launcher;

import android.app.Application;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.dawncraft.dawnlauncher.ui;
package io.github.dawncraft.launcher.ui;

import android.app.Fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import io.github.dawncraft.dawnlauncher.R;
import io.github.dawncraft.launcher.R;

public class FriendsFragment extends Fragment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.dawncraft.dawnlauncher.ui;
package io.github.dawncraft.launcher.ui;

import android.app.Fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import io.github.dawncraft.dawnlauncher.R;
import io.github.dawncraft.launcher.R;

public class GamesFragment extends Fragment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package io.github.dawncraft.dawnlauncher.ui;
package io.github.dawncraft.launcher.ui;

import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.daimajia.slider.library.SliderLayout;
import com.daimajia.slider.library.SliderTypes.BaseSliderView;
import com.daimajia.slider.library.SliderTypes.TextSliderView;

import io.github.dawncraft.dawnlauncher.R;
import io.github.dawncraft.launcher.R;

public class HomeFragment extends Fragment
public class HomeFragment extends Fragment implements BaseSliderView.OnSliderClickListener
{
protected Context mActivity;
SliderLayout sliderShow;
Expand All @@ -24,10 +24,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
View view = inflater.inflate(R.layout.fragment_home, container, false);
// Add slider
sliderShow = (SliderLayout) view.findViewById(R.id.slider);
// TextSliderView textSliderView = new TextSliderView(mActivity);
// textSliderView.description("示范图片")
// .image("http://img3.imgtn.bdimg.com/it/u=1798501903,126021128&fm=23&gp=0.jpg");
// sliderShow.addSlider(textSliderView);
TextSliderView textSliderView = new TextSliderView(mActivity);
textSliderView.description("示范图片")
.image("http://img.tuku.cn/file_thumb/201504/m2015041616571244.jpg")
.setOnSliderClickListener(this);
sliderShow.addSlider(textSliderView);

return view;
}
Expand All @@ -45,4 +46,10 @@ public void onDestroy()
sliderShow.stopAutoCycle();
super.onDestroy();
}

@Override
public void onSliderClick(BaseSliderView slider)
{

}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.github.dawncraft.dawnlauncher.ui;
package io.github.dawncraft.launcher.ui;

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
Expand All @@ -13,13 +15,10 @@
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.support.design.widget.BottomNavigationView;

import com.ashokvarma.bottomnavigation.BadgeItem;
import com.ashokvarma.bottomnavigation.BottomNavigationBar;
import com.ashokvarma.bottomnavigation.BottomNavigationItem;

import io.github.dawncraft.dawnlauncher.R;
import io.github.dawncraft.dawnlauncher.utils.Util;
import io.github.dawncraft.launcher.R;
import io.github.dawncraft.launcher.utils.Util;

public class MainActivity extends AppCompatActivity
{
Expand All @@ -32,29 +31,15 @@ public class MainActivity extends AppCompatActivity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.setContentView(R.layout.activity_main);
this.fragmentHome = new HomeFragment();
this.fragmentGames = new GamesFragment();
this.fragmentFriends = new FriendsFragment();
// Set tool bar
Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar);
setSupportActionBar(toolbar);
// Set tab bar
BadgeItem badgeItem = new BadgeItem();
badgeItem.setHideOnSelect(true)
.setText("new")
.setBackgroundColorResource(R.color.colorAccent)
.setBorderWidth(0);
BottomNavigationBar bottomBar = (BottomNavigationBar) findViewById(R.id.main_tabbar);
TabListener tabListener = new TabListener();
bottomBar.setBarBackgroundColor(R.color.white)
.addItem(new BottomNavigationItem(R.mipmap.ic_home, R.string.tab_home).setActiveColorResource(R.color.colorLight))
.addItem(new BottomNavigationItem(R.mipmap.ic_games, R.string.tab_games).setActiveColorResource(R.color.colorLight).setBadgeItem(badgeItem))
.addItem(new BottomNavigationItem(R.mipmap.ic_friends, R.string.tab_friends).setActiveColorResource(R.color.colorLight))
.setFirstSelectedPosition(0)
.setMode(BottomNavigationBar.MODE_FIXED)
.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC)
.setTabSelectedListener(tabListener)
.initialise();
this.setSupportActionBar(toolbar);
// Set menu
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar,
R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
Expand All @@ -64,14 +49,16 @@ protected void onCreate(Bundle savedInstanceState)
listview.setAdapter(new ArrayAdapter<>(this, R.layout.list_item_menu,
getResources().getStringArray(R.array.menu_items)));
listview.setOnItemClickListener(new MenuListener());
// Set main content
tabListener.onTabSelected(0);
// Set tab bar(Don't forget to add BadgeItem :)
BottomNavigationView bottomNavigation = (BottomNavigationView) findViewById(R.id.main_tabbar);
bottomNavigation.setOnNavigationItemSelectedListener(new TabListener());
bottomNavigation.setSelectedItemId(R.id.menu_home);
}

@Override
public void onBackPressed()
{
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_layout);
if (drawer.isDrawerOpen(GravityCompat.START))
{
drawer.closeDrawer(GravityCompat.START);
Expand All @@ -96,7 +83,7 @@ private class MenuListener implements ListView.OnItemClickListener
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_layout);
switch(position)
{
default: Util.toast(MainActivity.this, "错误,无此项目:" + position); break;
Expand All @@ -108,34 +95,31 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
}
}

private class TabListener implements BottomNavigationBar.OnTabSelectedListener
private class TabListener implements BottomNavigationView.OnNavigationItemSelectedListener
{
@Override
public void onTabSelected(int position)
public boolean onNavigationItemSelected(@NonNull MenuItem item)
{
FragmentTransaction transaction = getFragmentManager().beginTransaction();
switch (position)
BottomNavigationView bottomNavigation = (BottomNavigationView) findViewById(R.id.main_tabbar);
bottomNavigation.getMenu().getItem(0).setChecked(false);
bottomNavigation.getMenu().getItem(1).setChecked(false);
bottomNavigation.getMenu().getItem(2).setChecked(false);
item.setChecked(true);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
switch (item.getItemId())
{
case 0:
if (fragmentHome == null) fragmentHome = new HomeFragment();
transaction.replace(R.id.main_content, fragmentHome);
case R.id.menu_home:
transaction.replace(R.id.main_content_layout, fragmentHome);
break;
case 1:
if (fragmentGames == null) fragmentGames = new GamesFragment();
transaction.replace(R.id.main_content, fragmentGames);
case R.id.menu_games:
transaction.replace(R.id.main_content_layout, fragmentGames);
break;
case 2:
if (fragmentFriends == null) fragmentFriends = new FriendsFragment();
transaction.replace(R.id.main_content, fragmentFriends);
case R.id.menu_friends:
transaction.replace(R.id.main_content_layout, fragmentFriends);
break;
}
transaction.commit();
return false;
}

@Override
public void onTabUnselected(int position) {}

@Override
public void onTabReselected(int position) {}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.dawncraft.dawnlauncher.ui;
package io.github.dawncraft.launcher.ui;

import android.content.Intent;
import android.os.Bundle;
Expand All @@ -8,10 +8,8 @@
import android.preference.PreferenceManager;
import android.view.MenuItem;

import io.github.dawncraft.dawnlauncher.R;
import io.github.dawncraft.dawnlauncher.ui.base.AppCompatPreferenceActivity;

import java.util.List;
import io.github.dawncraft.launcher.R;
import io.github.dawncraft.launcher.ui.base.AppCompatPreferenceActivity;

public class SettingsActivity extends AppCompatPreferenceActivity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.dawncraft.dawnlauncher.ui;
package io.github.dawncraft.launcher.ui;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
Expand All @@ -8,7 +8,7 @@

import com.squareup.picasso.Picasso;

import io.github.dawncraft.dawnlauncher.R;
import io.github.dawncraft.launcher.R;

public class SplashActivity extends AppCompatActivity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.dawncraft.dawnlauncher.ui.base;
package io.github.dawncraft.launcher.ui.base;

import android.content.res.Configuration;
import android.os.Bundle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.dawncraft.dawnlauncher.utils;
package io.github.dawncraft.launcher.utils;

import android.content.Context;
import android.support.annotation.StringRes;
Expand Down
File renamed without changes.
Loading

0 comments on commit b3cb9d9

Please sign in to comment.