Skip to content

Commit

Permalink
Fixed #61 and some bugs from merging. Added names to Readme and incre…
Browse files Browse the repository at this point in the history
…ased Version number.
  • Loading branch information
Kamuno committed Mar 13, 2019
1 parent 53793bb commit 85661c6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 31 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ App-Icon, weather icons and backgrounds: <br />
Markus Hau<br />

Github-Users: <br />
ptrckkk<br />
ptrckkk (Patrick Mell) <br />
Thomas Glaser <br />
yonjuni (Karola Marky)<br />
Kamuno (Christopher Beckmann) <br />
xdema (translation to Italian)
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ apply plugin: 'com.android.application'
android {

compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "org.secuso.privacyfriendlyweather"
minSdkVersion 17
targetSdkVersion 26
versionCode 5
versionName "2.1"
versionCode 6
versionName "2.1.1"

buildConfigField "String", "DEFAULT_API_KEY", "\"3fb239a5397459ff57d21c5cc1ca1536\""
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.secuso.privacyfriendlyweather.activities;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
Expand All @@ -15,6 +16,7 @@
import org.secuso.privacyfriendlyweather.R;
import org.secuso.privacyfriendlyweather.database.CurrentWeatherData;
import org.secuso.privacyfriendlyweather.database.Forecast;
import org.secuso.privacyfriendlyweather.database.PFASQLiteHelper;
import org.secuso.privacyfriendlyweather.ui.updater.IUpdateableCityUI;
import org.secuso.privacyfriendlyweather.ui.updater.ViewUpdater;
import org.secuso.privacyfriendlyweather.ui.viewPager.WeatherPagerAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,6 @@ private PFASQLiteHelper(Context context) {
this.context = context;
}

@Override
public void onCreate(SQLiteDatabase db) {
// creating required tables
db.execSQL(CREATE_TABLE_CITIES);
db.execSQL(CREATE_TABLE_FORECASTS);
db.execSQL(CREATE_CURRENT_WEATHER);
db.execSQL(CREATE_TABLE_CITIES_TO_WATCH);
db.execSQL(CREATE_TABLE_CITIES_INDEX);

// save all the cities into the database
fillCityDatabase(db);

}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ private void getWeatherData() {
}
}

@Override
protected void onResume() {
super.onResume();

viewPagerPageChangeListener.onPageSelected(viewPager.getCurrentItem());
}

public void addCity() {
new AsyncTask<Void, Void, Void>() {

Expand Down Expand Up @@ -221,19 +228,6 @@ public void onPageSelected(int position) {
// last page. make button text to GOT IT
btnNext.setText(getString(R.string.okay));
btnSkip.setVisibility(View.GONE);

autoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.autoCompleteTvAddFirstStart);
cityTextViewGenerator.generate(autoCompleteTextView, 8, EditorInfo.IME_ACTION_DONE, new MyConsumer<City>() {
@Override
public void accept(City city) {
selectedCity = city;
}
}, new Runnable() {
@Override
public void run() {
performDone();
}
});
} else {
// still pages are left
btnNext.setText(getString(R.string.next));
Expand Down Expand Up @@ -277,6 +271,21 @@ public Object instantiateItem(ViewGroup container, int position) {
layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

View view = layoutInflater.inflate(layouts[position], container, false);

if(position == dots.length - 1) {
autoCompleteTextView = (AutoCompleteTextView) view.findViewById(R.id.autoCompleteTvAddFirstStart);
cityTextViewGenerator.generate(autoCompleteTextView, 8, EditorInfo.IME_ACTION_DONE, new MyConsumer<City>() {
@Override
public void accept(City city) {
selectedCity = city;
}
}, new Runnable() {
@Override
public void run() {
performDone();
}
});
}
container.addView(view);

return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public CharSequence getPageTitle(int position) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
// dateFormat.setCalendar(calendar);
// calendar.setTimeInMillis(lastUpdateTime*1000);

if(cities.size() == 0) {
return mContext.getString(R.string.app_name);
}
return cities.get(position).getCityName(); // + " (" + dateFormat.format(calendar.getTime()) + ")";
}

Expand Down

0 comments on commit 85661c6

Please sign in to comment.