This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 149
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
45 changed files
with
2,982 additions
and
100 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
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
68 changes: 68 additions & 0 deletions
68
app/src/main/java/com/davidmiguel/gobees/about/AboutActivity.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,68 @@ | ||
/* | ||
* GoBees | ||
* Copyright (c) 2016 - 2017 David Miguel Lozano | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. | ||
*/ | ||
|
||
package com.davidmiguel.gobees.about; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.ActionBar; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
|
||
import com.davidmiguel.gobees.R; | ||
import com.davidmiguel.gobees.utils.ActivityUtils; | ||
|
||
/** | ||
* About GoBees activity. | ||
*/ | ||
public class AboutActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.about_act); | ||
|
||
// Set up the toolbar | ||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
ActionBar actionBar = getSupportActionBar(); | ||
if (actionBar != null) { | ||
actionBar.setDisplayHomeAsUpEnabled(true); | ||
actionBar.setDisplayShowHomeEnabled(true); | ||
actionBar.setTitle(R.string.about_title); | ||
} | ||
|
||
// Add fragment to the activity | ||
AboutFragment aboutFragment = | ||
(AboutFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame); | ||
if (aboutFragment == null) { | ||
// Create the fragment | ||
aboutFragment = AboutFragment.newInstance(); | ||
ActivityUtils.addFragmentToActivity( | ||
getSupportFragmentManager(), aboutFragment, R.id.contentFrame); | ||
} | ||
|
||
// Create the presenter | ||
new AboutPresenter(aboutFragment); | ||
} | ||
|
||
@Override | ||
public boolean onSupportNavigateUp() { | ||
onBackPressed(); | ||
return true; | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
app/src/main/java/com/davidmiguel/gobees/about/AboutContract.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,92 @@ | ||
/* | ||
* GoBees | ||
* Copyright (c) 2016 - 2017 David Miguel Lozano | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. | ||
*/ | ||
|
||
package com.davidmiguel.gobees.about; | ||
|
||
import com.davidmiguel.gobees.utils.BasePresenter; | ||
import com.davidmiguel.gobees.utils.BaseView; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This specifies the contract between the view and the presenter. | ||
*/ | ||
interface AboutContract { | ||
|
||
interface View extends BaseView<AboutContract.Presenter> { | ||
|
||
/** | ||
* Shows app verion. | ||
* | ||
* @param version vresion number. | ||
*/ | ||
void showVersion(String version); | ||
|
||
/** | ||
* Opens website. | ||
* | ||
* @param url website url. | ||
*/ | ||
void openWebsite(int url); | ||
|
||
/** | ||
* Opens a modal window with the changelog. | ||
* | ||
* @param title title. | ||
* @param changelog data. | ||
*/ | ||
void openChangelog(int title, int changelog); | ||
|
||
/** | ||
* Opens a modal window with the license text. | ||
* | ||
* @param title modal title. | ||
* @param license license text. | ||
*/ | ||
void openLicence(String title, int license); | ||
|
||
/** | ||
* Shows list of libraries used in the app. | ||
* | ||
* @param libraries list of libraries. | ||
*/ | ||
void showLibraries(List<Library> libraries); | ||
|
||
} | ||
|
||
interface Presenter extends BasePresenter { | ||
|
||
/** | ||
* When website button is clicked. | ||
*/ | ||
void onWebsiteClicked(); | ||
|
||
/** | ||
* When changelog button is clicked. | ||
*/ | ||
void onChangelogClicked(); | ||
|
||
/** | ||
* When a license button is clicked. | ||
* | ||
* @param license type of license. | ||
*/ | ||
void onLicenseClicked(Library.License license); | ||
|
||
} | ||
} |
Oops, something went wrong.