Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Final Touches
  • Loading branch information
dragosholban committed Mar 11, 2018
1 parent a640494 commit c5434ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/src/main/AndroidManifest.xml
Expand Up @@ -9,15 +9,18 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".TimeZoneActivity" />
<activity android:name=".SelectTimezonesActivity"></activity>
<activity android:name=".TimeZoneActivity"
android:screenOrientation="portrait"/>
<activity android:name=".SelectTimezonesActivity"
android:screenOrientation="portrait"></activity>
</application>

</manifest>
Expand Up @@ -35,6 +35,7 @@ public class MainActivity extends AppCompatActivity {
TextView convertedDateTv;
ListView listView;
ArrayAdapter<String> adapter;
SeekBar seekBar;

private static int CHOOSE_TIME_ZONE_REQUEST_CODE = 1;
private static int SELECT_TIME_ZONES_REQUEST_CODE = 2;
Expand All @@ -46,7 +47,7 @@ protected void onCreate(Bundle savedInstanceState) {

loadPreferences();

SeekBar seekBar = findViewById(R.id.seekBar);
seekBar = findViewById(R.id.seekBar);
final TextView userTime = findViewById(R.id.userTime);
convertedTimeTv = findViewById(R.id.convertedTime);
convertedDateTv = findViewById(R.id.convertedDate);
Expand Down Expand Up @@ -223,4 +224,10 @@ public int compare(String s, String t1) {
}
}
}

public void convertCurrentDate(View view) {
localDate = new Date();
convertDate(userTimeZone, selectedTimeZone);
seekBar.setProgress(localDate.getHours());
}
}
3 changes: 3 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Expand Up @@ -28,8 +28,10 @@
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:background="@android:color/transparent"
android:onClick="showDatePicker"
android:text="Date"
android:textColor="@color/colorAccent"
app:layout_constraintBottom_toTopOf="@+id/timeZoneButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
Expand Down Expand Up @@ -64,6 +66,7 @@
android:id="@+id/convertedTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="convertCurrentDate"
android:text="00:00"
android:textColor="@color/colorAccent"
android:textSize="36dp"
Expand Down

0 comments on commit c5434ba

Please sign in to comment.