/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.example.android.quakereport;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;

public class EarthquakeActivity extends AppCompatActivity {

    public static final String LOG_TAG = EarthquakeActivity.class.getName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.earthquake_activity);

        // Create a fake list of earthquake locations.
        ArrayList<String> earthquakes = new ArrayList<>();
        earthquakes.add("San Francisco");
        earthquakes.add("London");
        earthquakes.add("Tokyo");
        earthquakes.add("Mexico City");
        earthquakes.add("Moscow");
        earthquakes.add("Rio de Janeiro");
        earthquakes.add("Paris");

        // Find a reference to the {@link ListView} in the layout
        ListView earthquakeListView = (ListView) findViewById(R.id.list);

        // Create a new {@link ArrayAdapter} of earthquakes
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                this, android.R.layout.simple_list_item_1, earthquakes);

        // Set the adapter on the {@link ListView}
        // so the list can be populated in the user interface
        earthquakeListView.setAdapter(adapter);
    }
}

@@ -1210,22 +1210,26 @@
 rayList%3C
-String
+Earthquake
 %3E earthq
@@ -1283,244 +1283,519 @@
 add(
-%22San Francisco%22);%0A        earthquakes.add(%22London%22);%0A        earthquakes.add(%22Tokyo%22);%0A        earthquakes.add(%22Mexico City%22);%0A        earthquakes.add(%22Moscow%22);%0A        earthquakes.add(%22Rio de Janeiro%22);%0A        earthquakes.add(%22Paris%22
+new Earthquake(%223.1%22, %22San Francisco%22, %22Jul 4, 2017%22));%0A        earthquakes.add(new Earthquake (%225.3%22, %22London%22,%22Aug 8, 2016%22));%0A        earthquakes.add(new Earthquake (%227.6%22, %22Tokyo%22, %22Feb 14, 2017%22));%0A        earthquakes.add(new Earthquake (%222.8%22, %22Mexico City%22, %22May 4, 2017%22));%0A        earthquakes.add(new Earthquake (%225.5%22, %22Moscow%22, %22Mar 17, 2017%22));%0A        earthquakes.add(new Earthquake (%226.9%22, %22Rio de Janeiro%22, %22Jul 12, 2017%22));%0A        earthquakes.add(new Earthquake (%223.7%22, %22Paris%22, %22May 24, 2017%22)
 );%0A%0A
@@ -2016,22 +2016,26 @@
 Adapter%3C
-String
+Earthquake
 %3E adapte
@@ -2055,22 +2055,16 @@
 Adapter%3C
-String
 %3E(%0A     

create new Earthquake object by calling the Earthquake constructor